From dde904157bd609f8d4e350b3f934250077962e74 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Wed, 15 Nov 2023 14:46:44 +0100 Subject: [PATCH] update zero trip guard check code --- src/hotspot/share/opto/predicates.cpp | 9 +++------ src/hotspot/share/opto/predicates.hpp | 2 -- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/opto/predicates.cpp b/src/hotspot/share/opto/predicates.cpp index 1809636f10540..c38ff4bcf024b 100644 --- a/src/hotspot/share/opto/predicates.cpp +++ b/src/hotspot/share/opto/predicates.cpp @@ -87,8 +87,9 @@ 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; } @@ -96,10 +97,6 @@ bool RuntimePredicate::may_be_runtime_predicate_if(Node* node) { 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()) { diff --git a/src/hotspot/share/opto/predicates.hpp b/src/hotspot/share/opto/predicates.hpp index 80ecfb46b47df..89d8bbad030d5 100644 --- a/src/hotspot/share/opto/predicates.hpp +++ b/src/hotspot/share/opto/predicates.hpp @@ -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);