< prev index next >

src/hotspot/share/adlc/formssel.cpp

Print this page




 761 // This instruction captures the machine-independent bottom_type
 762 // Expected use is for pointer vs oop determination for LoadP
 763 bool InstructForm::captures_bottom_type(FormDict &globals) const {
 764   if (_matrule && _matrule->_rChild &&
 765       (!strcmp(_matrule->_rChild->_opType,"CastPP")       ||  // new result type
 766        !strcmp(_matrule->_rChild->_opType,"CastX2P")      ||  // new result type
 767        !strcmp(_matrule->_rChild->_opType,"DecodeN")      ||
 768        !strcmp(_matrule->_rChild->_opType,"EncodeP")      ||
 769        !strcmp(_matrule->_rChild->_opType,"DecodeNKlass") ||
 770        !strcmp(_matrule->_rChild->_opType,"EncodePKlass") ||
 771        !strcmp(_matrule->_rChild->_opType,"LoadN")        ||
 772        !strcmp(_matrule->_rChild->_opType,"LoadNKlass")   ||
 773        !strcmp(_matrule->_rChild->_opType,"CreateEx")     ||  // type of exception
 774        !strcmp(_matrule->_rChild->_opType,"CheckCastPP")  ||
 775        !strcmp(_matrule->_rChild->_opType,"GetAndSetP")   ||
 776        !strcmp(_matrule->_rChild->_opType,"GetAndSetN")   ||
 777 #if INCLUDE_ZGC
 778        !strcmp(_matrule->_rChild->_opType,"LoadBarrierSlowReg") ||
 779        !strcmp(_matrule->_rChild->_opType,"LoadBarrierWeakSlowReg") ||
 780 #endif




 781        !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeP") ||
 782        !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeN")))  return true;
 783   else if ( is_ideal_load() == Form::idealP )                return true;
 784   else if ( is_ideal_store() != Form::none  )                return true;
 785 
 786   if (needs_base_oop_edge(globals)) return true;
 787 
 788   if (is_vector()) return true;
 789   if (is_mach_constant()) return true;
 790 
 791   return  false;
 792 }
 793 
 794 
 795 // Access instr_cost attribute or return NULL.
 796 const char* InstructForm::cost() {
 797   for (Attribute* cur = _attribs; cur != NULL; cur = (Attribute*)cur->_next) {
 798     if( strcmp(cur->_ident,AttributeForm::_ins_cost) == 0 ) {
 799       return cur->_val;
 800     }


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



3505     "StoreCM",
3506     "ClearArray",
3507     "GetAndSetB", "GetAndSetS", "GetAndAddI", "GetAndSetI", "GetAndSetP",
3508     "GetAndAddB", "GetAndAddS", "GetAndAddL", "GetAndSetL", "GetAndSetN",
3509     "LoadBarrierSlowReg", "LoadBarrierWeakSlowReg"
3510   };
3511   int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
3512   if( strcmp(_opType,"PrefetchAllocation")==0 )
3513     return 1;
3514   if( _lChild ) {
3515     const char *opType = _lChild->_opType;
3516     for( int i=0; i<cnt; i++ )
3517       if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3518         return 1;
3519     if( _lChild->needs_ideal_memory_edge(globals) )
3520       return 1;
3521   }
3522   if( _rChild ) {
3523     const char *opType = _rChild->_opType;
3524     for( int i=0; i<cnt; i++ )




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


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


< prev index next >