From e88e793cfd9a5db8745aa187c2726ad029b60ab7 Mon Sep 17 00:00:00 2001 From: theoweidmannoracle Date: Wed, 11 Dec 2024 07:52:06 +0000 Subject: [PATCH] 8343148: C2: Refactor uses of "PhaseValue::*con*() + PhaseIdealLoop::set_ctrl()" into separate method Reviewed-by: kvn, chagedorn, thartmann --- .../gc/shenandoah/c2/shenandoahSupport.cpp | 4 +- src/hotspot/share/opto/loopPredicate.cpp | 15 ++-- src/hotspot/share/opto/loopTransform.cpp | 47 ++++-------- src/hotspot/share/opto/loopnode.cpp | 71 ++++++++++++------- src/hotspot/share/opto/loopnode.hpp | 14 ++++ src/hotspot/share/opto/loopopts.cpp | 22 +++--- src/hotspot/share/opto/predicates.cpp | 3 +- src/hotspot/share/opto/vectorization.cpp | 4 +- 8 files changed, 90 insertions(+), 90 deletions(-) diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp index 10dd6509171..b59cc19a375 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -887,7 +887,7 @@ void ShenandoahBarrierC2Support::test_gc_state(Node*& ctrl, Node* raw_mem, Node* phase->register_new_node(gc_state_cmp, old_ctrl); phase->register_new_node(gc_state_bool, old_ctrl); - phase->set_ctrl(gc_state_offset, phase->C->root()); + phase->set_root_as_ctrl(gc_state_offset); assert(is_gc_state_test(gc_state_iff, flags), "Should match the shape"); } @@ -945,7 +945,7 @@ void ShenandoahBarrierC2Support::test_in_cset(Node*& ctrl, Node*& not_cset_ctrl, phase->register_control(ctrl, loop, cset_iff); phase->register_control(not_cset_ctrl, loop, cset_iff); - phase->set_ctrl(cset_addr_ptr, phase->C->root()); + phase->set_root_as_ctrl(cset_addr_ptr); phase->register_new_node(raw_val, old_ctrl); phase->register_new_node(cset_idx, old_ctrl); diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index 9340f7e0978..02649d3711a 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -766,8 +766,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(Node* ctrl, const int scale, Node* offset if ((stride > 0 && (java_subtract(limit_lo, stride) < limit_lo)) || (stride < 0 && (java_subtract(limit_hi, stride) > limit_hi))) { // No overflow possible - ConINode* con_stride = _igvn.intcon(stride); - set_ctrl(con_stride, C->root()); + ConINode* con_stride = intcon(stride); max_idx_expr = new SubINode(limit, con_stride); idx_type = TypeInt::make(limit_lo - stride, limit_hi - stride, limit_type->_widen); } else { @@ -775,8 +774,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(Node* ctrl, const int scale, Node* offset overflow = true; limit = new ConvI2LNode(limit); register_new_node(limit, ctrl); - ConLNode* con_stride = _igvn.longcon(stride); - set_ctrl(con_stride, C->root()); + ConLNode* con_stride = longcon(stride); max_idx_expr = new SubLNode(limit, con_stride); } register_new_node(max_idx_expr, ctrl); @@ -793,8 +791,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(Node* ctrl, const int scale, Node* offset } if (scale != 1) { - ConNode* con_scale = _igvn.intcon(scale); - set_ctrl(con_scale, C->root()); + ConNode* con_scale = intcon(scale); if (TraceLoopPredicate) { predString->print("* %d ", scale); } @@ -811,8 +808,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(Node* ctrl, const int scale, Node* offset register_new_node(max_idx_expr, ctrl); } overflow = true; - con_scale = _igvn.longcon(scale); - set_ctrl(con_scale, C->root()); + con_scale = longcon(scale); max_idx_expr = new MulLNode(max_idx_expr, con_scale); } else { // No overflow possible @@ -1342,8 +1338,7 @@ bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree* loop) { #endif return false; } - ConNode* zero = _igvn.intcon(0); - set_ctrl(zero, C->root()); + ConNode* zero = intcon(0); ResourceArea* area = Thread::current()->resource_area(); Invariance invar(area, loop); diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp index 6efad724917..a33d89993ad 100644 --- a/src/hotspot/share/opto/loopTransform.cpp +++ b/src/hotspot/share/opto/loopTransform.cpp @@ -354,15 +354,11 @@ Node* IdealLoopTree::reassociate_add_sub_cmp(Node* n1, int inv1_idx, int inv2_id Node* inv1_c = phase->get_ctrl(inv1); Node* n_inv1; if (neg_inv1) { - Node* zero; if (is_int) { - zero = phase->_igvn.intcon(0); - n_inv1 = new SubINode(zero, inv1); + n_inv1 = new SubINode(phase->intcon(0), inv1); } else { - zero = phase->_igvn.longcon(0L); - n_inv1 = new SubLNode(zero, inv1); + n_inv1 = new SubLNode(phase->longcon(0L), inv1); } - phase->set_ctrl(zero, phase->C->root()); phase->register_new_node(n_inv1, inv1_c); } else { n_inv1 = inv1; @@ -1711,8 +1707,7 @@ void PhaseIdealLoop::update_main_loop_assertion_predicates(CountedLoopNode* main // Compute the value of the loop induction variable at the end of the // first iteration of the unrolled loop: init + new_stride_con - init_inc int unrolled_stride_con = main_loop_head->stride_con() * 2; - Node* unrolled_stride = _igvn.intcon(unrolled_stride_con); - set_ctrl(unrolled_stride, C->root()); + Node* unrolled_stride = intcon(unrolled_stride_con); Node* loop_entry = main_loop_head->skip_strip_mined()->in(LoopNode::EntryControl); PredicateIterator predicate_iterator(loop_entry); @@ -1879,23 +1874,20 @@ void PhaseIdealLoop::do_unroll(IdealLoopTree *loop, Node_List &old_new, bool adj if (limit->is_Con()) { // The check in policy_unroll and the assert above guarantee // no underflow if limit is constant. - new_limit = _igvn.intcon(limit->get_int() - stride_con); - set_ctrl(new_limit, C->root()); + new_limit = intcon(limit->get_int() - stride_con); } else { // Limit is not constant. Int subtraction could lead to underflow. // (1) Convert to long. Node* limit_l = new ConvI2LNode(limit); register_new_node_with_ctrl_of(limit_l, limit); - Node* stride_l = _igvn.longcon(stride_con); - set_ctrl(stride_l, C->root()); + Node* stride_l = longcon(stride_con); // (2) Subtract: compute in long, to prevent underflow. Node* new_limit_l = new SubLNode(limit_l, stride_l); register_new_node(new_limit_l, ctrl); // (3) Clamp to int range, in case we had subtraction underflow. - Node* underflow_clamp_l = _igvn.longcon((stride_con > 0) ? min_jint : max_jint); - set_ctrl(underflow_clamp_l, C->root()); + Node* underflow_clamp_l = longcon((stride_con > 0) ? min_jint : max_jint); Node* new_limit_no_underflow_l = nullptr; if (stride_con > 0) { // limit = MaxL(limit - stride, min_jint) @@ -1985,8 +1977,7 @@ void PhaseIdealLoop::do_unroll(IdealLoopTree *loop, Node_List &old_new, bool adj // Kill the clone's backedge Node *newcle = old_new[loop_end->_idx]; _igvn.hash_delete(newcle); - Node *one = _igvn.intcon(1); - set_ctrl(one, C->root()); + Node* one = intcon(1); newcle->set_req(1, one); // Force clone into same loop body uint max = loop->_body.size(); @@ -2122,8 +2113,7 @@ void PhaseIdealLoop::add_constraint(jlong stride_con, jlong scale_con, Node* off // Only do this for the pre-loop, one less iteration of the main loop doesn't hurt. bool round = ABS(scale_con) > 1; - Node* scale = _igvn.longcon(scale_con); - set_ctrl(scale, C->root()); + Node* scale = longcon(scale_con); if ((stride_con^scale_con) >= 0) { // Use XOR to avoid overflow // Positive stride*scale: the affine function is increasing, @@ -2162,8 +2152,7 @@ void PhaseIdealLoop::add_constraint(jlong stride_con, jlong scale_con, Node* off // else /* scale > 0 and stride < 0 */ // I > (upper_limit-(offset+1))/scale // ) - Node* one = _igvn.longcon(1); - set_ctrl(one, C->root()); + Node* one = longcon(1); Node* plus_one = new AddLNode(offset, one); register_new_node(plus_one, pre_ctrl); *pre_limit = adjust_limit(!is_positive_stride, scale, plus_one, upper_limit, *pre_limit, pre_ctrl, round); @@ -2368,8 +2357,7 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, BasicType bt, *p_scale = scale; } if (p_offset != nullptr) { - Node *zero = _igvn.zerocon(bt); - set_ctrl(zero, C->root()); + Node* zero = zerocon(bt); *p_offset = zero; } return true; @@ -2420,8 +2408,7 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, BasicType bt, } if (p_offset != nullptr) { if (which == 1) { // must negate the extracted offset - Node *zero = _igvn.integercon(0, exp_bt); - set_ctrl(zero, C->root()); + Node* zero = integercon(0, exp_bt); Node *ctrl_off = get_ctrl(offset); offset = SubNode::make(zero, offset, exp_bt); register_new_node(offset, ctrl_off); @@ -2540,13 +2527,10 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree* loop) { int stride_con = cl->stride_con(); bool abs_stride_is_one = stride_con == 1 || stride_con == -1; - Node* zero = _igvn.longcon(0); - Node* one = _igvn.longcon(1); + Node* zero = longcon(0); + Node* one = longcon(1); // Use symmetrical int range [-max_jint,max_jint] - Node* mini = _igvn.longcon(-max_jint); - set_ctrl(zero, C->root()); - set_ctrl(one, C->root()); - set_ctrl(mini, C->root()); + Node* mini = longcon(-max_jint); Node* loop_entry = cl->skip_strip_mined()->in(LoopNode::EntryControl); assert(loop_entry->is_Proj() && loop_entry->in(0)->is_If(), "if projection only"); @@ -2745,8 +2729,7 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree* loop) { // Kill the eliminated test C->set_major_progress(); - Node *kill_con = _igvn.intcon(1-flip); - set_ctrl(kill_con, C->root()); + Node* kill_con = intcon(1-flip); _igvn.replace_input_of(iff, 1, kill_con); // Find surviving projection assert(iff->is_If(), ""); diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp index ca869129b24..72870613cb0 100644 --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -313,8 +313,7 @@ IdealLoopTree* PhaseIdealLoop::insert_outer_loop(IdealLoopTree* loop, LoopNode* IdealLoopTree* PhaseIdealLoop::create_outer_strip_mined_loop(BoolNode *test, Node *cmp, Node *init_control, IdealLoopTree* loop, float cl_prob, float le_fcnt, Node*& entry_control, Node*& iffalse) { - Node* outer_test = _igvn.intcon(0); - set_ctrl(outer_test, C->root()); + Node* outer_test = intcon(0); Node *orig = iffalse; iffalse = iffalse->clone(); _igvn.register_new_node_with_optimizer(iffalse); @@ -969,16 +968,14 @@ bool PhaseIdealLoop::create_loop_nest(IdealLoopTree* loop, Node_List &old_new) { inner_iters_actual_int = inner_iters_actual; } - Node* int_zero = _igvn.intcon(0); - set_ctrl(int_zero, C->root()); + Node* int_zero = intcon(0); if (stride_con < 0) { inner_iters_actual_int = new SubINode(int_zero, inner_iters_actual_int); _igvn.register_new_node_with_optimizer(inner_iters_actual_int); } // Clone the iv data nodes as an integer iv - Node* int_stride = _igvn.intcon(stride_con); - set_ctrl(int_stride, C->root()); + Node* int_stride = intcon(stride_con); Node* inner_phi = new PhiNode(x->in(0), TypeInt::INT); Node* inner_incr = new AddINode(inner_phi, int_stride); Node* inner_cmp = nullptr; @@ -1273,14 +1270,10 @@ int PhaseIdealLoop::extract_long_range_checks(const IdealLoopTree* loop, jint st void PhaseIdealLoop::transform_long_range_checks(int stride_con, const Node_List &range_checks, Node* outer_phi, Node* inner_iters_actual_int, Node* inner_phi, Node* iv_add, LoopNode* inner_head) { - Node* long_zero = _igvn.longcon(0); - set_ctrl(long_zero, C->root()); - Node* int_zero = _igvn.intcon(0); - set_ctrl(int_zero, this->C->root()); - Node* long_one = _igvn.longcon(1); - set_ctrl(long_one, this->C->root()); - Node* int_stride = _igvn.intcon(checked_cast(stride_con)); - set_ctrl(int_stride, this->C->root()); + Node* long_zero = longcon(0); + Node* int_zero = intcon(0); + Node* long_one = longcon(1); + Node* int_stride = intcon(checked_cast(stride_con)); for (uint i = 0; i < range_checks.size(); i++) { ProjNode* proj = range_checks.at(i)->as_Proj(); @@ -1302,8 +1295,7 @@ void PhaseIdealLoop::transform_long_range_checks(int stride_con, const Node_List Node* entry_control = inner_head->in(LoopNode::EntryControl); Node* R = range; - Node* K = _igvn.longcon(scale); - set_ctrl(K, this->C->root()); + Node* K = longcon(scale); Node* L = offset; @@ -1334,8 +1326,7 @@ void PhaseIdealLoop::transform_long_range_checks(int stride_con, const Node_List // So this transformation could cause spurious deoptimizations and failed range check elimination // (but not incorrect execution) for unlikely corner cases with overflow. // If this causes problems in practice, we could maybe direct execution to a post-loop, instead of deoptimizing. - Node* max_jint_plus_one_long = _igvn.longcon((jlong)max_jint + 1); - set_ctrl(max_jint_plus_one_long, C->root()); + Node* max_jint_plus_one_long = longcon((jlong)max_jint + 1); Node* max_range = new AddLNode(max_jint_plus_one_long, L); register_new_node(max_range, entry_control); R = MaxNode::unsigned_min(R, max_range, TypeLong::POS, _igvn); @@ -1389,8 +1380,7 @@ void PhaseIdealLoop::transform_long_range_checks(int stride_con, const Node_List // H_clamp = Q_max+1 < Q_min ? max_jlong : Q_max+1 // (Because Q_min and Q_max are close, the overflow check could also be encoded as Q_max+1 < 0 & Q_min >= 0.) - Node* max_jlong_long = _igvn.longcon(max_jlong); - set_ctrl(max_jlong_long, this->C->root()); + Node* max_jlong_long = longcon(max_jlong); Node* Q_max_cmp = new CmpLNode(Q_max_plus_one, Q_min); register_new_node(Q_max_cmp, entry_control); Node* Q_max_bool = new BoolNode(Q_max_cmp, BoolTest::lt); @@ -1424,8 +1414,7 @@ void PhaseIdealLoop::transform_long_range_checks(int stride_con, const Node_List // to: j*K + L_2 (scale)); - set_ctrl(K, this->C->root()); + K = intcon(checked_cast(scale)); Node* scaled_iv = new MulINode(inner_phi, K); register_new_node(scaled_iv, c); Node* scaled_iv_plus_offset = new AddINode(scaled_iv, L_2); @@ -3155,7 +3144,7 @@ void OuterStripMinedLoopNode::transform_to_counted_loop(PhaseIterGVN* igvn, Phas // make counted loop exit test always fail ConINode* zero = igvn->intcon(0); if (iloop != nullptr) { - iloop->set_ctrl(zero, igvn->C->root()); + iloop->set_root_as_ctrl(zero); } igvn->replace_input_of(cle, 1, zero); // replace outer loop end with CountedLoopEndNode with formers' CLE's exit test @@ -4067,8 +4056,7 @@ void PhaseIdealLoop::replace_parallel_iv(IdealLoopTree *loop) { // variable differs from the trip counter by a loop-invariant // amount, the difference between their respective initial values. // It is scaled by the 'ratio_con'. - Node* ratio = _igvn.integercon(ratio_con, stride_con2_bt); - set_ctrl(ratio, C->root()); + Node* ratio = integercon(ratio_con, stride_con2_bt); Node* init_converted = insert_convert_node_if_needed(stride_con2_bt, init); Node* phi_converted = insert_convert_node_if_needed(stride_con2_bt, phi); @@ -4488,8 +4476,7 @@ void PhaseIdealLoop::eliminate_useless_template_assertion_predicates(Unique_Node OpaqueTemplateAssertionPredicateNode* opaque_node = C->template_assertion_predicate_opaq_node(i - 1)->as_OpaqueTemplateAssertionPredicate(); if (!useful_predicates.member(opaque_node)) { // not in the useful list - ConINode* one = _igvn.intcon(1); - set_ctrl(one, C->root()); + ConINode* one = intcon(1); _igvn.replace_node(opaque_node, one); } } @@ -6870,6 +6857,36 @@ void PhaseIdealLoop::rpo(Node* start, Node_Stack &stk, VectorSet &visited, Node_ } } +ConINode* PhaseIdealLoop::intcon(jint i) { + ConINode* node = _igvn.intcon(i); + set_root_as_ctrl(node); + return node; +} + +ConLNode* PhaseIdealLoop::longcon(jlong i) { + ConLNode* node = _igvn.longcon(i); + set_root_as_ctrl(node); + return node; +} + +ConNode* PhaseIdealLoop::makecon(const Type* t) { + ConNode* node = _igvn.makecon(t); + set_root_as_ctrl(node); + return node; +} + +ConNode* PhaseIdealLoop::integercon(jlong l, BasicType bt) { + ConNode* node = _igvn.integercon(l, bt); + set_root_as_ctrl(node); + return node; +} + +ConNode* PhaseIdealLoop::zerocon(BasicType bt) { + ConNode* node = _igvn.zerocon(bt); + set_root_as_ctrl(node); + return node; +} + //============================================================================= //------------------------------LoopTreeIterator------------------------------- diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index 07a5e28b23e..da059f8c820 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -980,6 +980,10 @@ public: assert( ctrl == find_non_split_ctrl(ctrl), "must set legal crtl" ); _loop_or_ctrl.map(n->_idx, (Node*)((intptr_t)ctrl + 1)); } + void set_root_as_ctrl(Node* n) { + assert(!has_node(n) || has_ctrl(n), ""); + _loop_or_ctrl.map(n->_idx, (Node*)((intptr_t)C->root() + 1)); + } // Set control and update loop membership void set_ctrl_and_loop(Node* n, Node* ctrl) { IdealLoopTree* old_loop = get_loop(get_ctrl(n)); @@ -1784,6 +1788,16 @@ public: void pin_array_access_nodes_dependent_on(Node* ctrl); Node* ensure_node_and_inputs_are_above_pre_end(CountedLoopEndNode* pre_end, Node* node); + + ConINode* intcon(jint i); + + ConLNode* longcon(jlong i); + + ConNode* makecon(const Type* t); + + ConNode* integercon(jlong l, BasicType bt); + + ConNode* zerocon(BasicType bt); }; diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp index 2ac10bb31f0..54a6823de36 100644 --- a/src/hotspot/share/opto/loopopts.cpp +++ b/src/hotspot/share/opto/loopopts.cpp @@ -122,7 +122,7 @@ Node* PhaseIdealLoop::split_thru_phi(Node* n, Node* region, int policy) { if (singleton) { wins++; - x = ((PhaseGVN&)_igvn).makecon(t); + x = makecon(t); } else { // We now call Identity to try to simplify the cloned node. // Note that some Identity methods call phase->type(this). @@ -189,8 +189,7 @@ Node* PhaseIdealLoop::split_thru_phi(Node* n, Node* region, int policy) { IdealLoopTree *old_loop; if (x->is_Con()) { - // Constant's control is always root. - set_ctrl(x, C->root()); + assert(get_ctrl(x) == C->root(), "constant control is not root"); continue; } // The occasional new node @@ -331,8 +330,7 @@ void PhaseIdealLoop::dominated_by(IfProjNode* prevdom, IfNode* iff, bool flip, b pop = Op_IfTrue; } // 'con' is set to true or false to kill the dominated test. - Node *con = _igvn.makecon(pop == Op_IfTrue ? TypeInt::ONE : TypeInt::ZERO); - set_ctrl(con, C->root()); // Constant gets a new use + Node* con = makecon(pop == Op_IfTrue ? TypeInt::ONE : TypeInt::ZERO); // Hack the dominated test _igvn.replace_input_of(iff, 1, con); @@ -472,8 +470,7 @@ Node* PhaseIdealLoop::remix_address_expressions_add_left_shift(Node* n, IdealLoo if (add->Opcode() == Op_Sub(bt) && _igvn.type(add->in(1)) != TypeInteger::zero(bt)) { assert(add->Opcode() == Op_SubI || add->Opcode() == Op_SubL, ""); - Node* zero = _igvn.integercon(0, bt); - set_ctrl(zero, C->root()); + Node* zero = integercon(0, bt); Node* neg = SubNode::make(zero, add->in(2), bt); register_new_node_with_ctrl_of(neg, add->in(2)); add = AddNode::make(add->in(1), neg, bt); @@ -2915,8 +2912,7 @@ Node* PhaseIdealLoop::short_circuit_if(IfNode* iff, ProjNode* live_proj) { guarantee(live_proj != nullptr, "null projection"); int proj_con = live_proj->_con; assert(proj_con == 0 || proj_con == 1, "false or true projection"); - Node *con = _igvn.intcon(proj_con); - set_ctrl(con, C->root()); + Node* con = intcon(proj_con); if (iff) { iff->set_req(1, con); } @@ -3225,8 +3221,7 @@ IfNode* PhaseIdealLoop::insert_cmpi_loop_exit(IfNode* if_cmpu, IdealLoopTree* lo if (stride > 0) { rhs_cmpi = limit; // For i >= limit } else { - rhs_cmpi = _igvn.makecon(TypeInt::ZERO); // For i < 0 - set_ctrl(rhs_cmpi, C->root()); + rhs_cmpi = makecon(TypeInt::ZERO); // For i < 0 } // Create a new region on the exit path RegionNode* reg = insert_region_before_proj(lp_exit); @@ -3255,8 +3250,7 @@ void PhaseIdealLoop::remove_cmpi_loop_exit(IfNode* if_cmp, IdealLoopTree *loop) assert(if_cmp->in(1)->in(1)->Opcode() == Op_CmpI && stay_in_loop(lp_proj, loop)->is_If() && stay_in_loop(lp_proj, loop)->in(1)->in(1)->Opcode() == Op_CmpU, "inserted cmpi before cmpu"); - Node *con = _igvn.makecon(lp_proj->is_IfTrue() ? TypeInt::ONE : TypeInt::ZERO); - set_ctrl(con, C->root()); + Node* con = makecon(lp_proj->is_IfTrue() ? TypeInt::ONE : TypeInt::ZERO); if_cmp->set_req(1, con); } @@ -4638,7 +4632,7 @@ void PhaseIdealLoop::move_unordered_reduction_out_of_loop(IdealLoopTree* loop) { assert(first_ur != nullptr, "must have successfully terminated chain traversal"); Node* identity_scalar = ReductionNode::make_identity_con_scalar(_igvn, sopc, bt); - set_ctrl(identity_scalar, C->root()); + set_root_as_ctrl(identity_scalar); VectorNode* identity_vector = VectorNode::scalar2vector(identity_scalar, vector_length, bt); register_new_node(identity_vector, C->root()); assert(vec_t == identity_vector->vect_type(), "matching vector type"); diff --git a/src/hotspot/share/opto/predicates.cpp b/src/hotspot/share/opto/predicates.cpp index dd4cc04664b..1a023d04b68 100644 --- a/src/hotspot/share/opto/predicates.cpp +++ b/src/hotspot/share/opto/predicates.cpp @@ -274,8 +274,7 @@ bool InitializedAssertionPredicate::is_predicate(Node* node) { } void InitializedAssertionPredicate::kill(PhaseIdealLoop* phase) const { - Node* true_con = phase->igvn().intcon(1); - phase->set_ctrl(true_con, phase->C->root()); + Node* true_con = phase->intcon(1); phase->igvn().replace_input_of(_if_node, 1, true_con); } diff --git a/src/hotspot/share/opto/vectorization.cpp b/src/hotspot/share/opto/vectorization.cpp index 4d152189625..e7b0a149cd8 100644 --- a/src/hotspot/share/opto/vectorization.cpp +++ b/src/hotspot/share/opto/vectorization.cpp @@ -1215,9 +1215,7 @@ Node* VPointer::maybe_negate_invar(bool negate, Node* invar) { if (negate) { BasicType bt = invar->bottom_type()->basic_type(); assert(bt == T_INT || bt == T_LONG, ""); - PhaseIterGVN& igvn = phase()->igvn(); - Node* zero = igvn.zerocon(bt); - phase()->set_ctrl(zero, phase()->C->root()); + Node* zero = phase()->zerocon(bt); Node* sub = SubNode::make(zero, invar, bt); invar = register_if_new(sub); }