JIT: disable phi based redundant branch opts (#76695)
authorAndy Ayers <andya@microsoft.com>
Thu, 6 Oct 2022 14:13:23 +0000 (07:13 -0700)
committerGitHub <noreply@github.com>
Thu, 6 Oct 2022 14:13:23 +0000 (07:13 -0700)
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

index 1eec753..fb91d38 100644 (file)
@@ -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