[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 02:57:44 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:

I wonder if handling mixed poison-undef values is even necessary these days, as I think the frontend will never produce undef values? Can we check with llvm-opt-benchmark to see if there any changes end-to-end after stripping the undef handling?

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


More information about the llvm-commits mailing list