Skip to content

Commit 3727f40

Browse files
committed
8343745: Only update Last Value Assertion Predicates in Loop Unrolling
Reviewed-by: thartmann, kvn
1 parent b53ee05 commit 3727f40

File tree

7 files changed

+88
-85
lines changed

7 files changed

+88
-85
lines changed

src/hotspot/share/opto/cfgnode.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class IfNode : public MultiBranchNode {
324324
float _fcnt; // Frequency counter
325325

326326
private:
327-
NOT_PRODUCT(AssertionPredicateType _assertion_predicate_type;)
327+
AssertionPredicateType _assertion_predicate_type;
328328

329329
void init_node(Node* control, Node* bol) {
330330
init_class_id(Class_If);
@@ -426,7 +426,7 @@ class IfNode : public MultiBranchNode {
426426
// gen_subtype_check() and catch_inline_exceptions().
427427

428428
IfNode(Node* control, Node* bol, float p, float fcnt);
429-
NOT_PRODUCT(IfNode(Node* control, Node* bol, float p, float fcnt, AssertionPredicateType assertion_predicate_type);)
429+
IfNode(Node* control, Node* bol, float p, float fcnt, AssertionPredicateType assertion_predicate_type);
430430

431431
static IfNode* make_with_same_profile(IfNode* if_node_profile, Node* ctrl, BoolNode* bol);
432432

@@ -448,11 +448,11 @@ class IfNode : public MultiBranchNode {
448448
// Returns null is it couldn't improve the type.
449449
static const TypeInt* filtered_int_type(PhaseGVN* phase, Node* val, Node* if_proj);
450450

451-
#ifndef PRODUCT
452451
AssertionPredicateType assertion_predicate_type() const {
453452
return _assertion_predicate_type;
454453
}
455454

455+
#ifndef PRODUCT
456456
virtual void dump_spec(outputStream *st) const;
457457
#endif
458458

@@ -468,12 +468,10 @@ class RangeCheckNode : public IfNode {
468468
init_class_id(Class_RangeCheck);
469469
}
470470

471-
#ifndef PRODUCT
472471
RangeCheckNode(Node* control, Node* bol, float p, float fcnt, AssertionPredicateType assertion_predicate_type)
473472
: IfNode(control, bol, p, fcnt, assertion_predicate_type) {
474473
init_class_id(Class_RangeCheck);
475474
}
476-
#endif // NOT PRODUCT
477475

478476
virtual int Opcode() const;
479477
virtual Node* Ideal(PhaseGVN *phase, bool can_reshape);

src/hotspot/share/opto/ifnode.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,18 @@ extern uint explicit_null_checks_elided;
5050
IfNode::IfNode(Node* control, Node* bol, float p, float fcnt)
5151
: MultiBranchNode(2),
5252
_prob(p),
53-
_fcnt(fcnt)
54-
NOT_PRODUCT(COMMA _assertion_predicate_type(AssertionPredicateType::None)) {
53+
_fcnt(fcnt),
54+
_assertion_predicate_type(AssertionPredicateType::None) {
5555
init_node(control, bol);
5656
}
5757

58-
#ifndef PRODUCT
5958
IfNode::IfNode(Node* control, Node* bol, float p, float fcnt, AssertionPredicateType assertion_predicate_type)
6059
: MultiBranchNode(2),
6160
_prob(p),
6261
_fcnt(fcnt),
6362
_assertion_predicate_type(assertion_predicate_type) {
6463
init_node(control, bol);
6564
}
66-
#endif // NOT_PRODUCT
6765

6866
//=============================================================================
6967
//------------------------------Value------------------------------------------

src/hotspot/share/opto/loopPredicate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ void PhaseIdealLoop::register_control(Node* n, IdealLoopTree *loop, Node* pred,
100100
// is an IfTrue projection. This code is also used to clone predicates to cloned loops.
101101
IfTrueNode* PhaseIdealLoop::create_new_if_for_predicate(ParsePredicateSuccessProj* parse_predicate_success_proj,
102102
Node* new_entry, const Deoptimization::DeoptReason reason,
103-
const int opcode, const bool rewire_uncommon_proj_phi_inputs
104-
NOT_PRODUCT (COMMA AssertionPredicateType assertion_predicate_type)) {
103+
const int opcode, const bool rewire_uncommon_proj_phi_inputs,
104+
AssertionPredicateType assertion_predicate_type) {
105105
assert(parse_predicate_success_proj->is_uncommon_trap_if_pattern(reason), "must be a uct if pattern!");
106106
ParsePredicateNode* parse_predicate = parse_predicate_success_proj->in(0)->as_ParsePredicate();
107107
ParsePredicateUncommonProj* uncommon_proj = parse_predicate->uncommon_proj();

src/hotspot/share/opto/loopTransform.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,8 +2759,8 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) {
27592759
// cannot remove an empty loop with a constant limit when init is not a constant as well. We will use
27602760
// a LoopLimitCheck node that can only be folded if the zero grip guard is also foldable.
27612761
loop_entry = initialized_assertion_predicate_creator.create(final_iv_placeholder, loop_entry, stride_con,
2762-
scale_con, int_offset, int_limit NOT_PRODUCT(
2763-
COMMA AssertionPredicateType::FinalIv));
2762+
scale_con, int_offset, int_limit,
2763+
AssertionPredicateType::FinalIv);
27642764
assert(!assertion_predicate_has_loop_opaque_node(loop_entry->in(0)->as_If()), "unexpected");
27652765
}
27662766

@@ -2773,8 +2773,8 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree *loop, Node_List &old_new) {
27732773

27742774
// Initialized Assertion Predicate for the value of the initial main-loop.
27752775
loop_entry = initialized_assertion_predicate_creator.create(init, loop_entry, stride_con, scale_con,
2776-
int_offset, int_limit NOT_PRODUCT(COMMA
2777-
AssertionPredicateType::InitValue));
2776+
int_offset, int_limit,
2777+
AssertionPredicateType::InitValue);
27782778
assert(!assertion_predicate_has_loop_opaque_node(loop_entry->in(0)->as_If()), "unexpected");
27792779

27802780
} else {

src/hotspot/share/opto/loopnode.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,8 +1352,8 @@ class PhaseIdealLoop : public PhaseTransform {
13521352
// Create a new if above the uncommon_trap_if_pattern for the predicate to be promoted
13531353
IfTrueNode* create_new_if_for_predicate(
13541354
ParsePredicateSuccessProj* parse_predicate_proj, Node* new_entry, Deoptimization::DeoptReason reason, int opcode,
1355-
bool rewire_uncommon_proj_phi_inputs = false
1356-
NOT_PRODUCT (COMMA AssertionPredicateType assertion_predicate_type = AssertionPredicateType::None));
1355+
bool rewire_uncommon_proj_phi_inputs = false,
1356+
AssertionPredicateType assertion_predicate_type = AssertionPredicateType::None);
13571357

13581358
private:
13591359
// Helper functions for create_new_if_for_predicate()

0 commit comments

Comments
 (0)