< prev index next >

src/hotspot/share/adlc/formssel.cpp

Print this page




 773   return NO_MEMORY_OPERAND;
 774 }
 775 
 776 
 777 // This instruction captures the machine-independent bottom_type
 778 // Expected use is for pointer vs oop determination for LoadP
 779 bool InstructForm::captures_bottom_type(FormDict &globals) const {
 780   if (_matrule && _matrule->_rChild &&
 781       (!strcmp(_matrule->_rChild->_opType,"CastPP")       ||  // new result type
 782        !strcmp(_matrule->_rChild->_opType,"CastX2P")      ||  // new result type
 783        !strcmp(_matrule->_rChild->_opType,"DecodeN")      ||
 784        !strcmp(_matrule->_rChild->_opType,"EncodeP")      ||
 785        !strcmp(_matrule->_rChild->_opType,"DecodeNKlass") ||
 786        !strcmp(_matrule->_rChild->_opType,"EncodePKlass") ||
 787        !strcmp(_matrule->_rChild->_opType,"LoadN")        ||
 788        !strcmp(_matrule->_rChild->_opType,"LoadNKlass")   ||
 789        !strcmp(_matrule->_rChild->_opType,"CreateEx")     ||  // type of exception
 790        !strcmp(_matrule->_rChild->_opType,"CheckCastPP")  ||
 791        !strcmp(_matrule->_rChild->_opType,"GetAndSetP")   ||
 792        !strcmp(_matrule->_rChild->_opType,"GetAndSetN")   ||




 793        !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeP") ||
 794        !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeN")))  return true;
 795   else if ( is_ideal_load() == Form::idealP )                return true;
 796   else if ( is_ideal_store() != Form::none  )                return true;
 797 
 798   if (needs_base_oop_edge(globals)) return true;
 799 
 800   if (is_vector()) return true;
 801   if (is_mach_constant()) return true;
 802 
 803   return  false;
 804 }
 805 
 806 
 807 // Access instr_cost attribute or return NULL.
 808 const char* InstructForm::cost() {
 809   for (Attribute* cur = _attribs; cur != NULL; cur = (Attribute*)cur->_next) {
 810     if( strcmp(cur->_ident,AttributeForm::_ins_cost) == 0 ) {
 811       return cur->_val;
 812     }


3494     fprintf(fp," (%s ",_name);  // " (opcodeName "
3495     if(_lChild) _lChild->output(fp); //               left operand
3496     if(_rChild) _rChild->output(fp); //                    right operand
3497     fprintf(fp,")");                 //                                 ")"
3498   }
3499 }
3500 
3501 int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
3502   static const char *needs_ideal_memory_list[] = {
3503     "StoreI","StoreL","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
3504     "StoreB","StoreC","Store" ,"StoreFP",
3505     "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF"  ,
3506     "LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
3507     "StoreVector", "LoadVector",
3508     "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
3509     "LoadPLocked",
3510     "StorePConditional", "StoreIConditional", "StoreLConditional",
3511     "CompareAndSwapB", "CompareAndSwapS", "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
3512     "WeakCompareAndSwapB", "WeakCompareAndSwapS", "WeakCompareAndSwapI", "WeakCompareAndSwapL", "WeakCompareAndSwapP", "WeakCompareAndSwapN",
3513     "CompareAndExchangeB", "CompareAndExchangeS", "CompareAndExchangeI", "CompareAndExchangeL", "CompareAndExchangeP", "CompareAndExchangeN",



3514     "StoreCM",
3515     "ClearArray",
3516     "GetAndSetB", "GetAndSetS", "GetAndAddI", "GetAndSetI", "GetAndSetP",
3517     "GetAndAddB", "GetAndAddS", "GetAndAddL", "GetAndSetL", "GetAndSetN",
3518     "LoadBarrierSlowReg", "LoadBarrierWeakSlowReg"
3519   };
3520   int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
3521   if( strcmp(_opType,"PrefetchAllocation")==0 )
3522     return 1;
3523   if( _lChild ) {
3524     const char *opType = _lChild->_opType;
3525     for( int i=0; i<cnt; i++ )
3526       if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3527         return 1;
3528     if( _lChild->needs_ideal_memory_edge(globals) )
3529       return 1;
3530   }
3531   if( _rChild ) {
3532     const char *opType = _rChild->_opType;
3533     for( int i=0; i<cnt; i++ )




 773   return NO_MEMORY_OPERAND;
 774 }
 775 
 776 
 777 // This instruction captures the machine-independent bottom_type
 778 // Expected use is for pointer vs oop determination for LoadP
 779 bool InstructForm::captures_bottom_type(FormDict &globals) const {
 780   if (_matrule && _matrule->_rChild &&
 781       (!strcmp(_matrule->_rChild->_opType,"CastPP")       ||  // new result type
 782        !strcmp(_matrule->_rChild->_opType,"CastX2P")      ||  // new result type
 783        !strcmp(_matrule->_rChild->_opType,"DecodeN")      ||
 784        !strcmp(_matrule->_rChild->_opType,"EncodeP")      ||
 785        !strcmp(_matrule->_rChild->_opType,"DecodeNKlass") ||
 786        !strcmp(_matrule->_rChild->_opType,"EncodePKlass") ||
 787        !strcmp(_matrule->_rChild->_opType,"LoadN")        ||
 788        !strcmp(_matrule->_rChild->_opType,"LoadNKlass")   ||
 789        !strcmp(_matrule->_rChild->_opType,"CreateEx")     ||  // type of exception
 790        !strcmp(_matrule->_rChild->_opType,"CheckCastPP")  ||
 791        !strcmp(_matrule->_rChild->_opType,"GetAndSetP")   ||
 792        !strcmp(_matrule->_rChild->_opType,"GetAndSetN")   ||
 793 #if INCLUDE_SHENANDOAHGC
 794        !strcmp(_matrule->_rChild->_opType,"ShenandoahCompareAndExchangeP") ||
 795        !strcmp(_matrule->_rChild->_opType,"ShenandoahCompareAndExchangeN") ||
 796 #endif
 797        !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeP") ||
 798        !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeN")))  return true;
 799   else if ( is_ideal_load() == Form::idealP )                return true;
 800   else if ( is_ideal_store() != Form::none  )                return true;
 801 
 802   if (needs_base_oop_edge(globals)) return true;
 803 
 804   if (is_vector()) return true;
 805   if (is_mach_constant()) return true;
 806 
 807   return  false;
 808 }
 809 
 810 
 811 // Access instr_cost attribute or return NULL.
 812 const char* InstructForm::cost() {
 813   for (Attribute* cur = _attribs; cur != NULL; cur = (Attribute*)cur->_next) {
 814     if( strcmp(cur->_ident,AttributeForm::_ins_cost) == 0 ) {
 815       return cur->_val;
 816     }


3498     fprintf(fp," (%s ",_name);  // " (opcodeName "
3499     if(_lChild) _lChild->output(fp); //               left operand
3500     if(_rChild) _rChild->output(fp); //                    right operand
3501     fprintf(fp,")");                 //                                 ")"
3502   }
3503 }
3504 
3505 int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
3506   static const char *needs_ideal_memory_list[] = {
3507     "StoreI","StoreL","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
3508     "StoreB","StoreC","Store" ,"StoreFP",
3509     "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF"  ,
3510     "LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
3511     "StoreVector", "LoadVector",
3512     "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
3513     "LoadPLocked",
3514     "StorePConditional", "StoreIConditional", "StoreLConditional",
3515     "CompareAndSwapB", "CompareAndSwapS", "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
3516     "WeakCompareAndSwapB", "WeakCompareAndSwapS", "WeakCompareAndSwapI", "WeakCompareAndSwapL", "WeakCompareAndSwapP", "WeakCompareAndSwapN",
3517     "CompareAndExchangeB", "CompareAndExchangeS", "CompareAndExchangeI", "CompareAndExchangeL", "CompareAndExchangeP", "CompareAndExchangeN",
3518 #if INCLUDE_SHENANDOAHGC
3519     "ShenandoahCompareAndSwapN", "ShenandoahCompareAndSwapP", "ShenandoahWeakCompareAndSwapP", "ShenandoahWeakCompareAndSwapN", "ShenandoahCompareAndExchangeP", "ShenandoahCompareAndExchangeN",
3520 #endif
3521     "StoreCM",
3522     "ClearArray",
3523     "GetAndSetB", "GetAndSetS", "GetAndAddI", "GetAndSetI", "GetAndSetP",
3524     "GetAndAddB", "GetAndAddS", "GetAndAddL", "GetAndSetL", "GetAndSetN",
3525     "LoadBarrierSlowReg", "LoadBarrierWeakSlowReg"
3526   };
3527   int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
3528   if( strcmp(_opType,"PrefetchAllocation")==0 )
3529     return 1;
3530   if( _lChild ) {
3531     const char *opType = _lChild->_opType;
3532     for( int i=0; i<cnt; i++ )
3533       if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3534         return 1;
3535     if( _lChild->needs_ideal_memory_edge(globals) )
3536       return 1;
3537   }
3538   if( _rChild ) {
3539     const char *opType = _rChild->_opType;
3540     for( int i=0; i<cnt; i++ )


< prev index next >