[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) {
----------------
ayalz wrote:

nit: better start with the simpler !ComputeReductionResult case first?

All three Compute*Result cases can find EpiRedHeaderPhi by tracing it from Incoming instead of relying on direct operand, but better do so gradually?

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


More information about the llvm-commits mailing list