--- old/src/hotspot/share/opto/vector.cpp 2020-08-07 00:36:32.000000000 +0300 +++ new/src/hotspot/share/opto/vector.cpp 2020-08-07 00:36:31.000000000 +0300 @@ -33,9 +33,9 @@ void PhaseVector::optimize_vector_boxes() { Compile::TracePhase tp("vector_elimination", &timers[_t_vector_elimination]); + // Signal GraphKit it's post-parse phase. assert(C->inlining_incrementally() == false, "sanity"); - - C->set_inlining_incrementally(true); // FIXME another way to signal GraphKit it's post-parsing phase? + C->set_inlining_incrementally(true); C->for_igvn()->clear(); C->initial_gvn()->replace_with(&_igvn); @@ -48,7 +48,7 @@ expand_vbox_nodes(); eliminate_vbox_alloc_nodes(); - C->set_inlining_incrementally(false); // FIXME another way to signal GraphKit it's post-parsing phase? + C->set_inlining_incrementally(false); do_cleanup(); } @@ -59,15 +59,15 @@ Compile::TracePhase tp("vector_pru", &timers[_t_vector_pru]); ResourceMark rm; PhaseRemoveUseless pru(C->initial_gvn(), C->for_igvn()); + if (C->failing()) return; } - - if (C->failing()) return; - { Compile::TracePhase tp("incrementalInline_igvn", &timers[_t_vector_igvn]); _igvn = PhaseIterGVN(C->initial_gvn()); _igvn.optimize(); + if (C->failing()) return; } + C->print_method(PHASE_ITER_GVN_BEFORE_EA, 3); } void PhaseVector::scalarize_vbox_nodes() { @@ -103,7 +103,6 @@ VectorBoxNode* vbox = static_cast(n); expand_vbox_node(vbox); if (C->failing()) return; - C->print_method(PHASE_EXPAND_VBOX, vbox, 3); } if (C->failing()) return; macro_idx = MIN2(macro_idx - 1, C->macro_count() - 1); @@ -272,14 +271,15 @@ Node* vect = vec_box->in(VectorBoxNode::Value); Node* result = expand_vbox_node_helper(vbox, vect, vec_box->box_type(), vec_box->vec_type()); C->gvn_replace_by(vec_box, result); + C->print_method(PHASE_EXPAND_VBOX, vec_box, 3); } C->remove_macro_node(vec_box); } Node* PhaseVector::expand_vbox_node_helper(Node* vbox, - Node* vect, - const TypeInstPtr* box_type, - const TypeVect* vect_type) { + Node* vect, + const TypeInstPtr* box_type, + const TypeVect* vect_type) { if (vbox->is_Phi() && vect->is_Phi()) { assert(vbox->as_Phi()->region() == vect->as_Phi()->region(), ""); Node* new_phi = new PhiNode(vbox->as_Phi()->region(), box_type); @@ -294,7 +294,7 @@ return expand_vbox_alloc_node(vbox_alloc, vect, box_type, vect_type); } else { assert(!vbox->is_Phi(), ""); - // TODO: ensure that expanded vbox is initialized with the same value (vect). + // TODO: assert that expanded vbox is initialized with the same value (vect). return vbox; // already expanded } } @@ -321,7 +321,7 @@ bool is_mask = is_vector_mask(box_klass); if (is_mask && bt != T_BOOLEAN) { - value = gvn.transform(new VectorStoreMaskNode(value, bt, num_elem)); + value = gvn.transform(VectorStoreMaskNode::make(gvn, value, bt, num_elem)); // Although type of mask depends on its definition, in terms of storage everything is stored in boolean array. bt = T_BOOLEAN; assert(value->as_Vector()->bottom_type()->is_vect()->element_basic_type() == bt, @@ -373,6 +373,7 @@ kit.replace_call(vbox_alloc, vec_obj, true); C->remove_macro_node(vbox_alloc); + return vec_obj; }