hotspot/src/share/vm/adlc/formssel.cpp
changeset 23220 fc827339dc37
parent 22872 b6902ee5bc8d
child 24424 2658d7834c6e
equal deleted inserted replaced
23219:69e72eaf9f51 23220:fc827339dc37
   658   // Machine independent loads must be checked for anti-dependences
   658   // Machine independent loads must be checked for anti-dependences
   659   // Check if instruction has a USE of a memory operand class, or a def.
   659   // Check if instruction has a USE of a memory operand class, or a def.
   660   int USE_of_memory  = 0;
   660   int USE_of_memory  = 0;
   661   int DEF_of_memory  = 0;
   661   int DEF_of_memory  = 0;
   662   const char*    last_memory_DEF = NULL; // to test DEF/USE pairing in asserts
   662   const char*    last_memory_DEF = NULL; // to test DEF/USE pairing in asserts
       
   663   const char*    last_memory_USE = NULL;
   663   Component     *unique          = NULL;
   664   Component     *unique          = NULL;
   664   Component     *comp            = NULL;
   665   Component     *comp            = NULL;
   665   ComponentList &components      = (ComponentList &)_components;
   666   ComponentList &components      = (ComponentList &)_components;
   666 
   667 
   667   components.reset();
   668   components.reset();
   679       } else if( comp->isa(Component::USE) ) {
   680       } else if( comp->isa(Component::USE) ) {
   680         if( last_memory_DEF != NULL ) {
   681         if( last_memory_DEF != NULL ) {
   681           assert(0 == strcmp(last_memory_DEF, comp->_name), "every memory DEF is followed by a USE of the same name");
   682           assert(0 == strcmp(last_memory_DEF, comp->_name), "every memory DEF is followed by a USE of the same name");
   682           last_memory_DEF = NULL;
   683           last_memory_DEF = NULL;
   683         }
   684         }
   684         USE_of_memory++;
   685         // Handles same memory being used multiple times in the case of BMI1 instructions.
       
   686         if (last_memory_USE != NULL) {
       
   687           if (strcmp(comp->_name, last_memory_USE) != 0) {
       
   688             USE_of_memory++;
       
   689           }
       
   690         } else {
       
   691           USE_of_memory++;
       
   692         }
       
   693         last_memory_USE = comp->_name;
       
   694 
   685         if (DEF_of_memory == 0)  // defs take precedence
   695         if (DEF_of_memory == 0)  // defs take precedence
   686           unique = comp;
   696           unique = comp;
   687       } else {
   697       } else {
   688         assert(last_memory_DEF == NULL, "unpaired memory DEF");
   698         assert(last_memory_DEF == NULL, "unpaired memory DEF");
   689       }
   699       }