src/share/vm/opto/superword.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8129094 Sdiff src/share/vm/opto

src/share/vm/opto/superword.cpp

Print this page




 167         if (!n_tail->is_Mem()) {
 168           is_slp = false;
 169           break;
 170         }
 171       }
 172     }
 173 
 174     // This must happen after check of phi/if
 175     if (n->is_Phi() || n->is_If()) {
 176       ignored_loop_nodes[i] = n->_idx;
 177       continue;
 178     }
 179 
 180     if (n->is_LoadStore() || n->is_MergeMem() ||
 181       (n->is_Proj() && !n->as_Proj()->is_CFG())) {
 182       is_slp = false;
 183       break;
 184     }
 185 
 186     if (n->is_Mem()) {
 187       Node* adr = n->in(MemNode::Address);
 188       Node* n_ctrl = _phase->get_ctrl(adr);
 189 
 190       // save a queue of post process nodes
 191       if (n_ctrl != NULL && lpt()->is_member(_phase->get_loop(n_ctrl))) {
 192         MemNode* current = n->as_Mem();
 193         BasicType bt = current->memory_type();
 194         if (is_java_primitive(bt) == false) {
 195           ignored_loop_nodes[i] = n->_idx;
 196           continue;
 197         }


 198 


 199         // Process the memory expression
 200         int stack_idx = 0;
 201         bool have_side_effects = true;
 202         if (adr->is_AddP() == false) {
 203           nstack.push(adr, stack_idx++);
 204         } else {
 205           // Mark the components of the memory operation in nstack
 206           SWPointer p1(current, this, &nstack, true);
 207           have_side_effects = p1.node_stack()->is_nonempty();
 208         }
 209 
 210         // Process the pointer stack
 211         while (have_side_effects) {
 212           Node* pointer_node = nstack.node();
 213           for (uint j = 0; j < lpt()->_body.size(); j++) {
 214             Node* cur_node = lpt()->_body.at(j);
 215             if (cur_node == pointer_node) {
 216               ignored_loop_nodes[j] = cur_node->_idx;
 217               break;
 218             }
 219           }
 220           nstack.pop();
 221           have_side_effects = nstack.is_nonempty();
 222         }
 223       }
 224     }
 225   }
 226 
 227   if (is_slp) {
 228     // Now we try to find the maximum supported consistent vector which the machine
 229     // description can use
 230     for (uint i = 0; i < lpt()->_body.size(); i++) {
 231       if (ignored_loop_nodes[i] != -1) continue;
 232 
 233       BasicType bt;
 234       Node* n = lpt()->_body.at(i);
 235       if (n->is_Store()) {
 236         bt = n->as_Mem()->memory_type();
 237       }
 238       else {
 239         bt = n->bottom_type()->basic_type();
 240       }
 241 
 242       int cur_max_vector = Matcher::max_vector_size(bt);
 243 
 244       // If a max vector exists which is not larger than _local_loop_unroll_factor
 245       // stop looking, we already have the max vector to map to.
 246       if (cur_max_vector <= local_loop_unroll_factor) {
 247         is_slp = false;
 248 #ifndef PRODUCT
 249         if (TraceSuperWordLoopUnrollAnalysis) {
 250           tty->print_cr("slp analysis fails: unroll limit equals max vector\n");
 251         }
 252 #endif
 253         break;
 254       }
 255 
 256       // Map the maximal common vector
 257       if (VectorNode::implemented(n->Opcode(), cur_max_vector, bt)) {
 258         if (cur_max_vector < max_vector) {




 167         if (!n_tail->is_Mem()) {
 168           is_slp = false;
 169           break;
 170         }
 171       }
 172     }
 173 
 174     // This must happen after check of phi/if
 175     if (n->is_Phi() || n->is_If()) {
 176       ignored_loop_nodes[i] = n->_idx;
 177       continue;
 178     }
 179 
 180     if (n->is_LoadStore() || n->is_MergeMem() ||
 181       (n->is_Proj() && !n->as_Proj()->is_CFG())) {
 182       is_slp = false;
 183       break;
 184     }
 185 
 186     if (n->is_Mem()) {





 187       MemNode* current = n->as_Mem();
 188       BasicType bt = current->memory_type();
 189       if (is_java_primitive(bt) == false) {
 190         ignored_loop_nodes[i] = n->_idx;
 191         continue;
 192       }
 193       Node* adr = n->in(MemNode::Address);
 194       Node* n_ctrl = _phase->get_ctrl(adr);
 195 
 196       // save a queue of post process nodes
 197       if (n_ctrl != NULL && lpt()->is_member(_phase->get_loop(n_ctrl))) {
 198         // Process the memory expression
 199         int stack_idx = 0;
 200         bool have_side_effects = true;
 201         if (adr->is_AddP() == false) {
 202           nstack.push(adr, stack_idx++);
 203         } else {
 204           // Mark the components of the memory operation in nstack
 205           SWPointer p1(current, this, &nstack, true);
 206           have_side_effects = p1.node_stack()->is_nonempty();
 207         }
 208 
 209         // Process the pointer stack
 210         while (have_side_effects) {
 211           Node* pointer_node = nstack.node();
 212           for (uint j = 0; j < lpt()->_body.size(); j++) {
 213             Node* cur_node = lpt()->_body.at(j);
 214             if (cur_node == pointer_node) {
 215               ignored_loop_nodes[j] = cur_node->_idx;
 216               break;
 217             }
 218           }
 219           nstack.pop();
 220           have_side_effects = nstack.is_nonempty();
 221         }
 222       }
 223     }
 224   }
 225 
 226   if (is_slp) {
 227     // Now we try to find the maximum supported consistent vector which the machine
 228     // description can use
 229     for (uint i = 0; i < lpt()->_body.size(); i++) {
 230       if (ignored_loop_nodes[i] != -1) continue;
 231 
 232       BasicType bt;
 233       Node* n = lpt()->_body.at(i);
 234       if (n->is_Store()) {
 235         bt = n->as_Mem()->memory_type();
 236       } else {

 237         bt = n->bottom_type()->basic_type();
 238       }
 239 
 240       int cur_max_vector = Matcher::max_vector_size(bt);
 241 
 242       // If a max vector exists which is not larger than _local_loop_unroll_factor
 243       // stop looking, we already have the max vector to map to.
 244       if (cur_max_vector <= local_loop_unroll_factor) {
 245         is_slp = false;
 246 #ifndef PRODUCT
 247         if (TraceSuperWordLoopUnrollAnalysis) {
 248           tty->print_cr("slp analysis fails: unroll limit equals max vector\n");
 249         }
 250 #endif
 251         break;
 252       }
 253 
 254       // Map the maximal common vector
 255       if (VectorNode::implemented(n->Opcode(), cur_max_vector, bt)) {
 256         if (cur_max_vector < max_vector) {


src/share/vm/opto/superword.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File