From 33f78c064577026da90c66ba4d8fec7237ce9d7b Mon Sep 17 00:00:00 2001 From: Jakob Botsch Nielsen Date: Fri, 26 May 2023 21:12:09 +0200 Subject: [PATCH] JIT: Allow RBO for known relops even without a dominator (#86774) Delay the check for whether there is a dominator to the case where we're actually going to try to infer from it. --- src/coreclr/jit/redundantbranchopts.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/coreclr/jit/redundantbranchopts.cpp b/src/coreclr/jit/redundantbranchopts.cpp index dcbf9a1de62ce..9f5f2a6fda50e 100644 --- a/src/coreclr/jit/redundantbranchopts.cpp +++ b/src/coreclr/jit/redundantbranchopts.cpp @@ -459,11 +459,6 @@ bool Compiler::optRedundantBranch(BasicBlock* const block) unsigned matchCount = 0; const unsigned matchLimit = 4; - if (domBlock == nullptr) - { - return false; - } - // Unpack the tree's VN // ValueNum treeNormVN; @@ -482,6 +477,11 @@ bool Compiler::optRedundantBranch(BasicBlock* const block) } else { + if (domBlock == nullptr) + { + return false; + } + JITDUMP("Relop [%06u] " FMT_BB " value unknown, trying inference\n", dspTreeID(tree), block->bbNum); }