624 if( !form ) continue;
625 OpClassForm *op = form->is_opclass();
626 if( !op ) continue;
627 if( form->interface_type(globals) == Form::memory_interface ) {
628 if( comp->isa(Component::USE) ) USE_of_memory = true;
629 if( comp->isa(Component::DEF) ) {
630 OperandForm *oper = form->is_operand();
631 if( oper && oper->is_user_name_for_sReg() ) {
632 // Stack slots are unaliased memory handled by allocator
633 oper = oper; // debug stopping point !!!!!
634 } else {
635 DEF_of_memory = true;
636 }
637 }
638 }
639 }
640 return (USE_of_memory && !DEF_of_memory);
641 }
642
643
644 int InstructForm::memory_operand(FormDict &globals) const {
645 // Machine independent loads must be checked for anti-dependences
646 // Check if instruction has a USE of a memory operand class, or a def.
647 int USE_of_memory = 0;
648 int DEF_of_memory = 0;
649 const char* last_memory_DEF = NULL; // to test DEF/USE pairing in asserts
650 const char* last_memory_USE = NULL;
651 Component *unique = NULL;
652 Component *comp = NULL;
653 ComponentList &components = (ComponentList &)_components;
654
655 components.reset();
656 while( (comp = components.iter()) != NULL ) {
657 const Form *form = globals[comp->_type];
658 if( !form ) continue;
659 OpClassForm *op = form->is_opclass();
660 if( !op ) continue;
661 if( op->stack_slots_only(globals) ) continue;
662 if( form->interface_type(globals) == Form::memory_interface ) {
663 if( comp->isa(Component::DEF) ) {
1145 return "MachReturnNode";
1146 }
1147 else if (is_ideal_halt()) {
1148 return "MachHaltNode";
1149 }
1150 else if (is_ideal_safepoint()) {
1151 return "MachSafePointNode";
1152 }
1153 else if (is_ideal_if()) {
1154 return "MachIfNode";
1155 }
1156 else if (is_ideal_goto()) {
1157 return "MachGotoNode";
1158 }
1159 else if (is_ideal_fastlock()) {
1160 return "MachFastLockNode";
1161 }
1162 else if (is_ideal_nop()) {
1163 return "MachNopNode";
1164 }
1165 else if (is_ideal_membar()) {
1166 return "MachMemBarNode";
1167 }
1168 else if (is_ideal_jump()) {
1169 return "MachJumpNode";
1170 }
1171 else if (is_mach_constant()) {
1172 return "MachConstantNode";
1173 }
1174 else if (captures_bottom_type(globals)) {
1175 return "MachTypeNode";
1176 } else {
1177 return "MachNode";
1178 }
1179 assert( false, "ShouldNotReachHere()");
1180 return NULL;
1181 }
1182
1183 // Compare the instruction predicates for textual equality
1184 bool equivalent_predicates( const InstructForm *instr1, const InstructForm *instr2 ) {
1185 const Predicate *pred1 = instr1->_predicate;
1186 const Predicate *pred2 = instr2->_predicate;
1187 if( pred1 == NULL && pred2 == NULL ) {
4095 }
4096
4097 bool MatchRule::is_ideal_fastlock() const {
4098 if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
4099 return (strcmp(_rChild->_opType,"FastLock") == 0);
4100 }
4101 return false;
4102 }
4103
4104 bool MatchRule::is_ideal_membar() const {
4105 if( !_opType ) return false;
4106 return
4107 !strcmp(_opType,"MemBarAcquire") ||
4108 !strcmp(_opType,"MemBarRelease") ||
4109 !strcmp(_opType,"MemBarAcquireLock") ||
4110 !strcmp(_opType,"MemBarReleaseLock") ||
4111 !strcmp(_opType,"LoadFence" ) ||
4112 !strcmp(_opType,"StoreFence") ||
4113 !strcmp(_opType,"MemBarVolatile") ||
4114 !strcmp(_opType,"MemBarCPUOrder") ||
4115 !strcmp(_opType,"MemBarStoreStore") ||
4116 !strcmp(_opType,"OnSpinWait");
4117 }
4118
4119 bool MatchRule::is_ideal_loadPC() const {
4120 if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
4121 return (strcmp(_rChild->_opType,"LoadPC") == 0);
4122 }
4123 return false;
4124 }
4125
4126 bool MatchRule::is_ideal_box() const {
4127 if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
4128 return (strcmp(_rChild->_opType,"Box") == 0);
4129 }
4130 return false;
4131 }
4132
4133 bool MatchRule::is_ideal_goto() const {
4134 bool ideal_goto = false;
4135
4136 if( _opType && (strcmp(_opType,"Goto") == 0) ) {
|
624 if( !form ) continue;
625 OpClassForm *op = form->is_opclass();
626 if( !op ) continue;
627 if( form->interface_type(globals) == Form::memory_interface ) {
628 if( comp->isa(Component::USE) ) USE_of_memory = true;
629 if( comp->isa(Component::DEF) ) {
630 OperandForm *oper = form->is_operand();
631 if( oper && oper->is_user_name_for_sReg() ) {
632 // Stack slots are unaliased memory handled by allocator
633 oper = oper; // debug stopping point !!!!!
634 } else {
635 DEF_of_memory = true;
636 }
637 }
638 }
639 }
640 return (USE_of_memory && !DEF_of_memory);
641 }
642
643
644 bool InstructForm::is_wide_memory_kill(FormDict &globals) const {
645 if( _matrule == NULL ) return false;
646 if( !_matrule->_opType ) return false;
647
648 if( strcmp(_matrule->_opType,"MemBarRelease") == 0 ) return true;
649 if( strcmp(_matrule->_opType,"MemBarAcquire") == 0 ) return true;
650 if( strcmp(_matrule->_opType,"MemBarReleaseLock") == 0 ) return true;
651 if( strcmp(_matrule->_opType,"MemBarAcquireLock") == 0 ) return true;
652 if( strcmp(_matrule->_opType,"MemBarStoreStore") == 0 ) return true;
653 if( strcmp(_matrule->_opType,"MemBarVolatile") == 0 ) return true;
654 if( strcmp(_matrule->_opType,"StoreFence") == 0 ) return true;
655 if( strcmp(_matrule->_opType,"LoadFence") == 0 ) return true;
656
657 return false;
658 }
659
660 int InstructForm::memory_operand(FormDict &globals) const {
661 // Machine independent loads must be checked for anti-dependences
662 // Check if instruction has a USE of a memory operand class, or a def.
663 int USE_of_memory = 0;
664 int DEF_of_memory = 0;
665 const char* last_memory_DEF = NULL; // to test DEF/USE pairing in asserts
666 const char* last_memory_USE = NULL;
667 Component *unique = NULL;
668 Component *comp = NULL;
669 ComponentList &components = (ComponentList &)_components;
670
671 components.reset();
672 while( (comp = components.iter()) != NULL ) {
673 const Form *form = globals[comp->_type];
674 if( !form ) continue;
675 OpClassForm *op = form->is_opclass();
676 if( !op ) continue;
677 if( op->stack_slots_only(globals) ) continue;
678 if( form->interface_type(globals) == Form::memory_interface ) {
679 if( comp->isa(Component::DEF) ) {
1161 return "MachReturnNode";
1162 }
1163 else if (is_ideal_halt()) {
1164 return "MachHaltNode";
1165 }
1166 else if (is_ideal_safepoint()) {
1167 return "MachSafePointNode";
1168 }
1169 else if (is_ideal_if()) {
1170 return "MachIfNode";
1171 }
1172 else if (is_ideal_goto()) {
1173 return "MachGotoNode";
1174 }
1175 else if (is_ideal_fastlock()) {
1176 return "MachFastLockNode";
1177 }
1178 else if (is_ideal_nop()) {
1179 return "MachNopNode";
1180 }
1181 else if (is_ideal_jump()) {
1182 return "MachJumpNode";
1183 }
1184 else if (is_mach_constant()) {
1185 return "MachConstantNode";
1186 }
1187 else if (captures_bottom_type(globals)) {
1188 return "MachTypeNode";
1189 } else {
1190 return "MachNode";
1191 }
1192 assert( false, "ShouldNotReachHere()");
1193 return NULL;
1194 }
1195
1196 // Compare the instruction predicates for textual equality
1197 bool equivalent_predicates( const InstructForm *instr1, const InstructForm *instr2 ) {
1198 const Predicate *pred1 = instr1->_predicate;
1199 const Predicate *pred2 = instr2->_predicate;
1200 if( pred1 == NULL && pred2 == NULL ) {
4108 }
4109
4110 bool MatchRule::is_ideal_fastlock() const {
4111 if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
4112 return (strcmp(_rChild->_opType,"FastLock") == 0);
4113 }
4114 return false;
4115 }
4116
4117 bool MatchRule::is_ideal_membar() const {
4118 if( !_opType ) return false;
4119 return
4120 !strcmp(_opType,"MemBarAcquire") ||
4121 !strcmp(_opType,"MemBarRelease") ||
4122 !strcmp(_opType,"MemBarAcquireLock") ||
4123 !strcmp(_opType,"MemBarReleaseLock") ||
4124 !strcmp(_opType,"LoadFence" ) ||
4125 !strcmp(_opType,"StoreFence") ||
4126 !strcmp(_opType,"MemBarVolatile") ||
4127 !strcmp(_opType,"MemBarCPUOrder") ||
4128 !strcmp(_opType,"MemBarStoreStore");
4129 }
4130
4131 bool MatchRule::is_ideal_loadPC() const {
4132 if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
4133 return (strcmp(_rChild->_opType,"LoadPC") == 0);
4134 }
4135 return false;
4136 }
4137
4138 bool MatchRule::is_ideal_box() const {
4139 if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
4140 return (strcmp(_rChild->_opType,"Box") == 0);
4141 }
4142 return false;
4143 }
4144
4145 bool MatchRule::is_ideal_goto() const {
4146 bool ideal_goto = false;
4147
4148 if( _opType && (strcmp(_opType,"Goto") == 0) ) {
|