764
765 return NO_MEMORY_OPERAND;
766 }
767
768
769 // This instruction captures the machine-independent bottom_type
770 // Expected use is for pointer vs oop determination for LoadP
771 bool InstructForm::captures_bottom_type(FormDict &globals) const {
772 if( _matrule && _matrule->_rChild &&
773 (!strcmp(_matrule->_rChild->_opType,"CastPP") || // new result type
774 !strcmp(_matrule->_rChild->_opType,"CastX2P") || // new result type
775 !strcmp(_matrule->_rChild->_opType,"DecodeN") ||
776 !strcmp(_matrule->_rChild->_opType,"EncodeP") ||
777 !strcmp(_matrule->_rChild->_opType,"DecodeNKlass") ||
778 !strcmp(_matrule->_rChild->_opType,"EncodePKlass") ||
779 !strcmp(_matrule->_rChild->_opType,"LoadN") ||
780 !strcmp(_matrule->_rChild->_opType,"LoadNKlass") ||
781 !strcmp(_matrule->_rChild->_opType,"CreateEx") || // type of exception
782 !strcmp(_matrule->_rChild->_opType,"CheckCastPP") ||
783 !strcmp(_matrule->_rChild->_opType,"GetAndSetP") ||
784 !strcmp(_matrule->_rChild->_opType,"GetAndSetN")) ) return true;
785 else if ( is_ideal_load() == Form::idealP ) return true;
786 else if ( is_ideal_store() != Form::none ) return true;
787
788 if (needs_base_oop_edge(globals)) return true;
789
790 if (is_vector()) return true;
791 if (is_mach_constant()) return true;
792
793 return false;
794 }
795
796
797 // Access instr_cost attribute or return NULL.
798 const char* InstructForm::cost() {
799 for (Attribute* cur = _attribs; cur != NULL; cur = (Attribute*)cur->_next) {
800 if( strcmp(cur->_ident,AttributeForm::_ins_cost) == 0 ) {
801 return cur->_val;
802 }
803 }
804 return NULL;
3470 if(_rChild) _rChild->output(fp); // right operand
3471 fprintf(fp,")"); // ")"
3472 }
3473 }
3474
3475 int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
3476 static const char *needs_ideal_memory_list[] = {
3477 "StoreI","StoreL","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
3478 "StoreB","StoreC","Store" ,"StoreFP",
3479 "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF" ,
3480 "LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
3481 "StoreVector", "LoadVector",
3482 "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
3483 "LoadPLocked",
3484 "StorePConditional", "StoreIConditional", "StoreLConditional",
3485 "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
3486 "StoreCM",
3487 "ClearArray",
3488 "GetAndAddI", "GetAndSetI", "GetAndSetP",
3489 "GetAndAddL", "GetAndSetL", "GetAndSetN",
3490 };
3491 int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
3492 if( strcmp(_opType,"PrefetchAllocation")==0 )
3493 return 1;
3494 if( _lChild ) {
3495 const char *opType = _lChild->_opType;
3496 for( int i=0; i<cnt; i++ )
3497 if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3498 return 1;
3499 if( _lChild->needs_ideal_memory_edge(globals) )
3500 return 1;
3501 }
3502 if( _rChild ) {
3503 const char *opType = _rChild->_opType;
3504 for( int i=0; i<cnt; i++ )
3505 if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3506 return 1;
3507 if( _rChild->needs_ideal_memory_edge(globals) )
3508 return 1;
3509 }
|
764
765 return NO_MEMORY_OPERAND;
766 }
767
768
769 // This instruction captures the machine-independent bottom_type
770 // Expected use is for pointer vs oop determination for LoadP
771 bool InstructForm::captures_bottom_type(FormDict &globals) const {
772 if( _matrule && _matrule->_rChild &&
773 (!strcmp(_matrule->_rChild->_opType,"CastPP") || // new result type
774 !strcmp(_matrule->_rChild->_opType,"CastX2P") || // new result type
775 !strcmp(_matrule->_rChild->_opType,"DecodeN") ||
776 !strcmp(_matrule->_rChild->_opType,"EncodeP") ||
777 !strcmp(_matrule->_rChild->_opType,"DecodeNKlass") ||
778 !strcmp(_matrule->_rChild->_opType,"EncodePKlass") ||
779 !strcmp(_matrule->_rChild->_opType,"LoadN") ||
780 !strcmp(_matrule->_rChild->_opType,"LoadNKlass") ||
781 !strcmp(_matrule->_rChild->_opType,"CreateEx") || // type of exception
782 !strcmp(_matrule->_rChild->_opType,"CheckCastPP") ||
783 !strcmp(_matrule->_rChild->_opType,"GetAndSetP") ||
784 !strcmp(_matrule->_rChild->_opType,"GetAndSetN") ||
785 !strcmp(_matrule->_rChild->_opType,"ShenandoahReadBarrier") ||
786 !strcmp(_matrule->_rChild->_opType,"ShenandoahWriteBarrier")) ) 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 }
805 }
806 return NULL;
3472 if(_rChild) _rChild->output(fp); // right operand
3473 fprintf(fp,")"); // ")"
3474 }
3475 }
3476
3477 int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
3478 static const char *needs_ideal_memory_list[] = {
3479 "StoreI","StoreL","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
3480 "StoreB","StoreC","Store" ,"StoreFP",
3481 "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF" ,
3482 "LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
3483 "StoreVector", "LoadVector",
3484 "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
3485 "LoadPLocked",
3486 "StorePConditional", "StoreIConditional", "StoreLConditional",
3487 "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
3488 "StoreCM",
3489 "ClearArray",
3490 "GetAndAddI", "GetAndSetI", "GetAndSetP",
3491 "GetAndAddL", "GetAndSetL", "GetAndSetN",
3492 "ShenandoahReadBarrier", "ShenandoahWriteBarrier",
3493 };
3494 int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
3495 if( strcmp(_opType,"PrefetchAllocation")==0 )
3496 return 1;
3497 if( _lChild ) {
3498 const char *opType = _lChild->_opType;
3499 for( int i=0; i<cnt; i++ )
3500 if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3501 return 1;
3502 if( _lChild->needs_ideal_memory_edge(globals) )
3503 return 1;
3504 }
3505 if( _rChild ) {
3506 const char *opType = _rChild->_opType;
3507 for( int i=0; i<cnt; i++ )
3508 if( strcmp(opType,needs_ideal_memory_list[i]) == 0 )
3509 return 1;
3510 if( _rChild->needs_ideal_memory_edge(globals) )
3511 return 1;
3512 }
|