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

via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 4 04:59:29 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);
----------------
ayalz wrote:

`EpiRedResult->getOperand(0)` is aka `Incoming`, or could the match of zext-or-sext change it?

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


More information about the llvm-commits mailing list