From 553f21ae5324029eef3c934d69be40f5d4266457 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Tue, 26 Mar 2024 11:43:35 +0000 Subject: [PATCH] 8327413: Enhance compilation efficiency Co-authored-by: Roland Westrelin Reviewed-by: ahgross, rhalade, thartmann, epeter, mbalao, fferrari --- src/hotspot/share/opto/ifnode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/opto/ifnode.cpp b/src/hotspot/share/opto/ifnode.cpp index a5722c45a5e..cedbc66bbb4 100644 --- a/src/hotspot/share/opto/ifnode.cpp +++ b/src/hotspot/share/opto/ifnode.cpp @@ -773,6 +773,7 @@ bool IfNode::cmpi_folds(PhaseIterGVN* igvn, bool fold_ne) { bool IfNode::is_ctrl_folds(Node* ctrl, PhaseIterGVN* igvn) { return ctrl != nullptr && ctrl->is_Proj() && + ctrl->outcnt() == 1 && // No side-effects ctrl->in(0) != nullptr && ctrl->in(0)->Opcode() == Op_If && ctrl->in(0)->outcnt() == 2 && @@ -1346,7 +1347,7 @@ Node* IfNode::fold_compares(PhaseIterGVN* igvn) { if (cmpi_folds(igvn)) { Node* ctrl = in(0); - if (is_ctrl_folds(ctrl, igvn) && ctrl->outcnt() == 1) { + if (is_ctrl_folds(ctrl, igvn)) { // A integer comparison immediately dominated by another integer // comparison ProjNode* success = nullptr;