[llvm] [VPlan] Remove MaskedCond and preserve SSA in early exits (PR #201784)

Andrei Elovikov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 09:46:11 PDT 2026


================
@@ -3380,6 +3368,12 @@ bool VPlanTransforms::handleUncountableEarlyExits(
           ExitIRI->getIncomingValueForBlock(EarlyExitingVPBB);
       VPValue *NewIncoming = IncomingVal;
       if (!isa<VPIRValue>(IncomingVal)) {
+        // Add phis so IncomingVal is defined on all paths to the latch.
+        DenseMap<VPBasicBlock *, VPValue *> Defs = {
+            {HeaderVPBB, Plan.getPoison(IncomingVal->getScalarType())}};
----------------
eas wrote:

Is it possible that `IncomingVal` could have been speculated/hoisted to a preheader/entry block?

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


More information about the llvm-commits mailing list