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

Max Brandtner via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 03:41:26 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,
----------------
MaxBrandtner-IBM wrote:

I just optimized the existing logic. I'm fine either way, but I think it's probably better to offload that kind of behavior change to a separate PR.

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


More information about the llvm-commits mailing list