[llvm] [VPlan] Preserve SSA in early exits (PR #201784)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 07:03:59 PDT 2026
================
@@ -3471,6 +3465,15 @@ 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())}};
+ VPBasicBlock *DefVPBB = IncomingVal->getDefiningRecipe()->getParent();
----------------
david-arm wrote:
What guarantees this has a definining recipe? Should we be asserting that `IncomingVal->hasDefiningRecipe()` is true?
https://github.com/llvm/llvm-project/pull/201784
More information about the llvm-commits
mailing list