@@ -313,8 +313,7 @@ IdealLoopTree* PhaseIdealLoop::insert_outer_loop(IdealLoopTree* loop, LoopNode*
313
313
IdealLoopTree* PhaseIdealLoop::create_outer_strip_mined_loop (BoolNode *test, Node *cmp, Node *init_control,
314
314
IdealLoopTree* loop, float cl_prob, float le_fcnt,
315
315
Node*& entry_control, Node*& iffalse) {
316
- Node* outer_test = _igvn.intcon (0 );
317
- set_ctrl (outer_test, C->root ());
316
+ Node* outer_test = intcon (0 );
318
317
Node *orig = iffalse;
319
318
iffalse = iffalse->clone ();
320
319
_igvn.register_new_node_with_optimizer (iffalse);
@@ -969,16 +968,14 @@ bool PhaseIdealLoop::create_loop_nest(IdealLoopTree* loop, Node_List &old_new) {
969
968
inner_iters_actual_int = inner_iters_actual;
970
969
}
971
970
972
- Node* int_zero = _igvn.intcon (0 );
973
- set_ctrl (int_zero, C->root ());
971
+ Node* int_zero = intcon (0 );
974
972
if (stride_con < 0 ) {
975
973
inner_iters_actual_int = new SubINode (int_zero, inner_iters_actual_int);
976
974
_igvn.register_new_node_with_optimizer (inner_iters_actual_int);
977
975
}
978
976
979
977
// Clone the iv data nodes as an integer iv
980
- Node* int_stride = _igvn.intcon (stride_con);
981
- set_ctrl (int_stride, C->root ());
978
+ Node* int_stride = intcon (stride_con);
982
979
Node* inner_phi = new PhiNode (x->in (0 ), TypeInt::INT);
983
980
Node* inner_incr = new AddINode (inner_phi, int_stride);
984
981
Node* inner_cmp = nullptr ;
@@ -1273,14 +1270,10 @@ int PhaseIdealLoop::extract_long_range_checks(const IdealLoopTree* loop, jint st
1273
1270
void PhaseIdealLoop::transform_long_range_checks (int stride_con, const Node_List &range_checks, Node* outer_phi,
1274
1271
Node* inner_iters_actual_int, Node* inner_phi,
1275
1272
Node* iv_add, LoopNode* inner_head) {
1276
- Node* long_zero = _igvn.longcon (0 );
1277
- set_ctrl (long_zero, C->root ());
1278
- Node* int_zero = _igvn.intcon (0 );
1279
- set_ctrl (int_zero, this ->C ->root ());
1280
- Node* long_one = _igvn.longcon (1 );
1281
- set_ctrl (long_one, this ->C ->root ());
1282
- Node* int_stride = _igvn.intcon (checked_cast<int >(stride_con));
1283
- set_ctrl (int_stride, this ->C ->root ());
1273
+ Node* long_zero = longcon (0 );
1274
+ Node* int_zero = intcon (0 );
1275
+ Node* long_one = longcon (1 );
1276
+ Node* int_stride = intcon (checked_cast<int >(stride_con));
1284
1277
1285
1278
for (uint i = 0 ; i < range_checks.size (); i++) {
1286
1279
ProjNode* proj = range_checks.at (i)->as_Proj ();
@@ -1302,8 +1295,7 @@ void PhaseIdealLoop::transform_long_range_checks(int stride_con, const Node_List
1302
1295
Node* entry_control = inner_head->in (LoopNode::EntryControl);
1303
1296
1304
1297
Node* R = range;
1305
- Node* K = _igvn.longcon (scale);
1306
- set_ctrl (K, this ->C ->root ());
1298
+ Node* K = longcon (scale);
1307
1299
1308
1300
Node* L = offset;
1309
1301
@@ -1334,8 +1326,7 @@ void PhaseIdealLoop::transform_long_range_checks(int stride_con, const Node_List
1334
1326
// So this transformation could cause spurious deoptimizations and failed range check elimination
1335
1327
// (but not incorrect execution) for unlikely corner cases with overflow.
1336
1328
// If this causes problems in practice, we could maybe direct execution to a post-loop, instead of deoptimizing.
1337
- Node* max_jint_plus_one_long = _igvn.longcon ((jlong)max_jint + 1 );
1338
- set_ctrl (max_jint_plus_one_long, C->root ());
1329
+ Node* max_jint_plus_one_long = longcon ((jlong)max_jint + 1 );
1339
1330
Node* max_range = new AddLNode (max_jint_plus_one_long, L);
1340
1331
register_new_node (max_range, entry_control);
1341
1332
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
1389
1380
1390
1381
// H_clamp = Q_max+1 < Q_min ? max_jlong : Q_max+1
1391
1382
// (Because Q_min and Q_max are close, the overflow check could also be encoded as Q_max+1 < 0 & Q_min >= 0.)
1392
- Node* max_jlong_long = _igvn.longcon (max_jlong);
1393
- set_ctrl (max_jlong_long, this ->C ->root ());
1383
+ Node* max_jlong_long = longcon (max_jlong);
1394
1384
Node* Q_max_cmp = new CmpLNode (Q_max_plus_one, Q_min);
1395
1385
register_new_node (Q_max_cmp, entry_control);
1396
1386
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
1424
1414
// to: j*K + L_2 <u32 R_2
1425
1415
// that is:
1426
1416
// (j*K + Q_first) - L_clamp <u32 clamp(R, L_clamp, H_clamp) - L_clamp
1427
- K = _igvn.intcon (checked_cast<int >(scale));
1428
- set_ctrl (K, this ->C ->root ());
1417
+ K = intcon (checked_cast<int >(scale));
1429
1418
Node* scaled_iv = new MulINode (inner_phi, K);
1430
1419
register_new_node (scaled_iv, c);
1431
1420
Node* scaled_iv_plus_offset = new AddINode (scaled_iv, L_2);
@@ -3155,7 +3144,7 @@ void OuterStripMinedLoopNode::transform_to_counted_loop(PhaseIterGVN* igvn, Phas
3155
3144
// make counted loop exit test always fail
3156
3145
ConINode* zero = igvn->intcon (0 );
3157
3146
if (iloop != nullptr ) {
3158
- iloop->set_ctrl (zero, igvn-> C -> root () );
3147
+ iloop->set_root_as_ctrl (zero);
3159
3148
}
3160
3149
igvn->replace_input_of (cle, 1 , zero);
3161
3150
// replace outer loop end with CountedLoopEndNode with formers' CLE's exit test
@@ -4067,8 +4056,7 @@ void PhaseIdealLoop::replace_parallel_iv(IdealLoopTree *loop) {
4067
4056
// variable differs from the trip counter by a loop-invariant
4068
4057
// amount, the difference between their respective initial values.
4069
4058
// It is scaled by the 'ratio_con'.
4070
- Node* ratio = _igvn.integercon (ratio_con, stride_con2_bt);
4071
- set_ctrl (ratio, C->root ());
4059
+ Node* ratio = integercon (ratio_con, stride_con2_bt);
4072
4060
4073
4061
Node* init_converted = insert_convert_node_if_needed (stride_con2_bt, init);
4074
4062
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
4488
4476
OpaqueTemplateAssertionPredicateNode* opaque_node =
4489
4477
C->template_assertion_predicate_opaq_node (i - 1 )->as_OpaqueTemplateAssertionPredicate ();
4490
4478
if (!useful_predicates.member (opaque_node)) { // not in the useful list
4491
- ConINode* one = _igvn.intcon (1 );
4492
- set_ctrl (one, C->root ());
4479
+ ConINode* one = intcon (1 );
4493
4480
_igvn.replace_node (opaque_node, one);
4494
4481
}
4495
4482
}
@@ -6870,6 +6857,36 @@ void PhaseIdealLoop::rpo(Node* start, Node_Stack &stk, VectorSet &visited, Node_
6870
6857
}
6871
6858
}
6872
6859
6860
+ ConINode* PhaseIdealLoop::intcon (jint i) {
6861
+ ConINode* node = _igvn.intcon (i);
6862
+ set_root_as_ctrl (node);
6863
+ return node;
6864
+ }
6865
+
6866
+ ConLNode* PhaseIdealLoop::longcon (jlong i) {
6867
+ ConLNode* node = _igvn.longcon (i);
6868
+ set_root_as_ctrl (node);
6869
+ return node;
6870
+ }
6871
+
6872
+ ConNode* PhaseIdealLoop::makecon (const Type* t) {
6873
+ ConNode* node = _igvn.makecon (t);
6874
+ set_root_as_ctrl (node);
6875
+ return node;
6876
+ }
6877
+
6878
+ ConNode* PhaseIdealLoop::integercon (jlong l, BasicType bt) {
6879
+ ConNode* node = _igvn.integercon (l, bt);
6880
+ set_root_as_ctrl (node);
6881
+ return node;
6882
+ }
6883
+
6884
+ ConNode* PhaseIdealLoop::zerocon (BasicType bt) {
6885
+ ConNode* node = _igvn.zerocon (bt);
6886
+ set_root_as_ctrl (node);
6887
+ return node;
6888
+ }
6889
+
6873
6890
6874
6891
// =============================================================================
6875
6892
// ------------------------------LoopTreeIterator-------------------------------
0 commit comments