[llvm] [SimplifyCFG] Skip phi scans when folded block shares no predecessors (PR #225647)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 04:32:11 PDT 2026


================
@@ -963,6 +961,25 @@ static void gatherIncomingValuesToPhi(PHINode *PN,
   }
 }
 
+/// If the incoming values of a phi at \p UndefOps are a mix of undef and
+/// poison, replace the poison values with undef.
+///
+/// \param PN The phi whose incoming values are replaced.
+/// \param UndefOps The indices of incoming values that are undef or poison.
+static void replacePoisonWithUndefIfMixed(PHINode *PN,
----------------
artagnon wrote:

So, the reason I'm suggesting this is because the patch as-is has degenerate compile-time blow up in certain cases, as I suspected: https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/1525. I think the ultimate fix is actually just stripping the undef handling?

https://github.com/llvm/llvm-project/pull/225647


More information about the llvm-commits mailing list