[llvm] [VPlan] Replace PhiR operand of ComputeRdxResult with VPIRFlags. (PR #174026)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 6 14:40:25 PST 2026


================
@@ -7305,8 +7305,20 @@ static void fixReductionScalarResumeWhenVectorizingEpilog(
        EpiRedResult->getOpcode() != VPInstruction::ComputeFindIVResult))
     return;
 
-  auto *EpiRedHeaderPhi =
-      cast<VPReductionPHIRecipe>(EpiRedResult->getOperand(0));
+  VPReductionPHIRecipe *EpiRedHeaderPhi;
+  if (EpiRedResult->getOpcode() == VPInstruction::ComputeReductionResult) {
+    // Find the reduction phi by looking at the other user of operand 0.
+    VPValue *Op = EpiRedResult->getOperand(0);
----------------
fhahn wrote:

`Incoming` is the incoming for the epilogue resume phi recipe.

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


More information about the llvm-commits mailing list