Skip to content

Commit

Permalink
update zero trip guard check code
Browse files Browse the repository at this point in the history
  • Loading branch information
chhagedorn committed Nov 15, 2023
1 parent 4413de3 commit dde9041
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/hotspot/share/opto/predicates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,16 @@ bool RuntimePredicate::is_success_proj(Node* node, Deoptimization::DeoptReason d
// A Runtime Predicate must have an If or a RangeCheck node, while the If should not be a zero trip guard check.
bool RuntimePredicate::may_be_runtime_predicate_if(Node* node) {
if (node->is_IfProj()) {
const int opcode_if = node->in(0)->Opcode();
if ((opcode_if == Op_If && is_not_zero_trip_guard(node->as_IfProj()))
const IfNode* if_node = node->in(0)->as_If();
const int opcode_if = if_node->Opcode();
if ((opcode_if == Op_If && !if_node->is_zero_trip_guard())
|| opcode_if == Op_RangeCheck) {
return true;
}
}
return false;
}

bool RuntimePredicate::is_not_zero_trip_guard(const IfProjNode* if_proj) {
return !if_proj->in(0)->as_If()->is_zero_trip_guard();
}

ParsePredicateIterator::ParsePredicateIterator(const Predicates& predicates) : _current_index(0) {
const PredicateBlock* loop_limit_check_predicate_block = predicates.loop_limit_check_predicate_block();
if (loop_limit_check_predicate_block->has_parse_predicate()) {
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/opto/predicates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,7 @@ class ParsePredicate : public StackObj {
// Utility class for queries on Runtime Predicates.
class RuntimePredicate : public StackObj {
static Deoptimization::DeoptReason uncommon_trap_reason(IfProjNode* if_proj);

static bool may_be_runtime_predicate_if(Node* node);
static bool is_not_zero_trip_guard(const IfProjNode* if_proj);

public:
static bool is_success_proj(Node* node, Deoptimization::DeoptReason deopt_reason);
Expand Down

0 comments on commit dde9041

Please sign in to comment.