src/hotspot/share/opto/superword.cpp
changeset 48309 1a0499fd252e
parent 48145 f913f6dba2d3
child 48370 cfde2a53d393
equal deleted inserted replaced
48308:00bd985f3dec 48309:1a0499fd252e
    56   _data_entry(arena(), 8,  0, NULL),      // nodes with all inputs from outside
    56   _data_entry(arena(), 8,  0, NULL),      // nodes with all inputs from outside
    57   _mem_slice_head(arena(), 8,  0, NULL),  // memory slice heads
    57   _mem_slice_head(arena(), 8,  0, NULL),  // memory slice heads
    58   _mem_slice_tail(arena(), 8,  0, NULL),  // memory slice tails
    58   _mem_slice_tail(arena(), 8,  0, NULL),  // memory slice tails
    59   _node_info(arena(), 8,  0, SWNodeInfo::initial), // info needed per node
    59   _node_info(arena(), 8,  0, SWNodeInfo::initial), // info needed per node
    60   _clone_map(phase->C->clone_map()),      // map of nodes created in cloning
    60   _clone_map(phase->C->clone_map()),      // map of nodes created in cloning
    61   _cmovev_kit(_arena, this),              // map to facilitate CMoveVD creation
    61   _cmovev_kit(_arena, this),              // map to facilitate CMoveV creation
    62   _align_to_ref(NULL),                    // memory reference to align vectors to
    62   _align_to_ref(NULL),                    // memory reference to align vectors to
    63   _disjoint_ptrs(arena(), 8,  0, OrderedPair::initial), // runtime disambiguated pointer pairs
    63   _disjoint_ptrs(arena(), 8,  0, OrderedPair::initial), // runtime disambiguated pointer pairs
    64   _dg(_arena),                            // dependence graph
    64   _dg(_arena),                            // dependence graph
    65   _visited(arena()),                      // visited node set
    65   _visited(arena()),                      // visited node set
    66   _post_visited(arena()),                 // post visited node set
    66   _post_visited(arena()),                 // post visited node set
   509     }
   509     }
   510 
   510 
   511     combine_packs();
   511     combine_packs();
   512 
   512 
   513     construct_my_pack_map();
   513     construct_my_pack_map();
   514 
   514     if (UseVectorCmov) {
   515     if (_do_vector_loop) {
       
   516       merge_packs_to_cmovd();
   515       merge_packs_to_cmovd();
   517     }
   516     }
   518 
   517 
   519     filter_packs();
   518     filter_packs();
   520 
   519 
  1247   }
  1246   }
  1248 }
  1247 }
  1249 
  1248 
  1250 //------------------------------data_size---------------------------
  1249 //------------------------------data_size---------------------------
  1251 int SuperWord::data_size(Node* s) {
  1250 int SuperWord::data_size(Node* s) {
  1252   Node* use = NULL; //test if the node is a candidate for CMoveVD optimization, then return the size of CMov
  1251   Node* use = NULL; //test if the node is a candidate for CMoveV optimization, then return the size of CMov
  1253   if (_do_vector_loop) {
  1252   if (UseVectorCmov) {
  1254     use = _cmovev_kit.is_Bool_candidate(s);
  1253     use = _cmovev_kit.is_Bool_candidate(s);
  1255     if (use != NULL) {
  1254     if (use != NULL) {
  1256       return data_size(use);
  1255       return data_size(use);
  1257     }
  1256     }
  1258     use = _cmovev_kit.is_CmpD_candidate(s);
  1257     use = _cmovev_kit.is_CmpD_candidate(s);
  1259     if (use != NULL) {
  1258     if (use != NULL) {
  1260       return data_size(use);
  1259       return data_size(use);
  1261     }
  1260     }
  1262   }
  1261   }
       
  1262 
  1263   int bsize = type2aelembytes(velt_basic_type(s));
  1263   int bsize = type2aelembytes(velt_basic_type(s));
  1264   assert(bsize != 0, "valid size");
  1264   assert(bsize != 0, "valid size");
  1265   return bsize;
  1265   return bsize;
  1266 }
  1266 }
  1267 
  1267 
  1716 Node_List* CMoveKit::make_cmovevd_pack(Node_List* cmovd_pk) {
  1716 Node_List* CMoveKit::make_cmovevd_pack(Node_List* cmovd_pk) {
  1717   Node *cmovd = cmovd_pk->at(0);
  1717   Node *cmovd = cmovd_pk->at(0);
  1718   if (!cmovd->is_CMove()) {
  1718   if (!cmovd->is_CMove()) {
  1719     return NULL;
  1719     return NULL;
  1720   }
  1720   }
       
  1721   if (cmovd->Opcode() != Op_CMoveF && cmovd->Opcode() != Op_CMoveD) {
       
  1722     return NULL;
       
  1723   }
  1721   if (pack(cmovd) != NULL) { // already in the cmov pack
  1724   if (pack(cmovd) != NULL) { // already in the cmov pack
  1722     return NULL;
  1725     return NULL;
  1723   }
  1726   }
  1724   if (cmovd->in(0) != NULL) {
  1727   if (cmovd->in(0) != NULL) {
  1725     NOT_PRODUCT(if(_sw->is_trace_cmov()) {tty->print("CMoveKit::make_cmovevd_pack: CMoveD %d has control flow, escaping...", cmovd->_idx); cmovd->dump();})
  1728     NOT_PRODUCT(if(_sw->is_trace_cmov()) {tty->print("CMoveKit::make_cmovevd_pack: CMoveD %d has control flow, escaping...", cmovd->_idx); cmovd->dump();})
  2375           }
  2378           }
  2376           ShouldNotReachHere();
  2379           ShouldNotReachHere();
  2377         }
  2380         }
  2378         BasicType bt = velt_basic_type(n);
  2381         BasicType bt = velt_basic_type(n);
  2379         const TypeVect* vt = TypeVect::make(bt, vlen);
  2382         const TypeVect* vt = TypeVect::make(bt, vlen);
  2380         vn = new CMoveVDNode(cc, src1, src2, vt);
  2383         assert(bt == T_FLOAT || bt == T_DOUBLE, "Only vectorization for FP cmovs is supported");
       
  2384         if (bt == T_FLOAT) {
       
  2385           vn = new CMoveVFNode(cc, src1, src2, vt);
       
  2386         } else {
       
  2387           assert(bt == T_DOUBLE, "Expected double");
       
  2388           vn = new CMoveVDNode(cc, src1, src2, vt);
       
  2389         }
  2381         NOT_PRODUCT(if(is_trace_cmov()) {tty->print("SWPointer::output: created new CMove node %d: ", vn->_idx); vn->dump();})
  2390         NOT_PRODUCT(if(is_trace_cmov()) {tty->print("SWPointer::output: created new CMove node %d: ", vn->_idx); vn->dump();})
  2382       } else if (opc == Op_FmaD || opc == Op_FmaF) {
  2391       } else if (opc == Op_FmaD || opc == Op_FmaF) {
  2383         // Promote operands to vector
  2392         // Promote operands to vector
  2384         Node* in1 = vector_opd(p, 1);
  2393         Node* in1 = vector_opd(p, 1);
  2385         Node* in2 = vector_opd(p, 2);
  2394         Node* in2 = vector_opd(p, 2);