From 5750b55419862f38720d2c84090148542589ddf9 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Wed, 5 Oct 2022 18:18:16 -0700 Subject: [PATCH] JIT: disable phi based redundant branch opts This is exposing our lack of SSA update and leading downstream opts like CSE and assertion prop to make bad decisions. Disabling for now until I have time to figure out how to safely enable. Fixes #76636, #76507 --- src/coreclr/jit/redundantbranchopts.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/coreclr/jit/redundantbranchopts.cpp b/src/coreclr/jit/redundantbranchopts.cpp index 1eec7530b6b196..fb91d3897e8a30 100644 --- a/src/coreclr/jit/redundantbranchopts.cpp +++ b/src/coreclr/jit/redundantbranchopts.cpp @@ -657,7 +657,12 @@ bool Compiler::optRedundantBranch(BasicBlock* const block) // We were unable to determine the relop value via dominance checks. // See if we can jump thread via phi disambiguation. // - return optJumpThreadPhi(block, tree, treeNormVN); + // optJumpThreadPhi disabled as it is exposing problems with stale SSA. + // See issue #76636 and related. + // + // return optJumpThreadPhi(block, tree, treeNormVN); + + return false; } // Be conservative if there is an exception effect and we're in an EH region