[llvm] [VPlan] Introduce ComputeReductionResult VPInstruction opcode. (PR #70253)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 24 13:35:08 PST 2023


================
@@ -404,6 +405,138 @@ Value *VPInstruction::generateInstruction(VPTransformState &State,
     Builder.GetInsertBlock()->getTerminator()->eraseFromParent();
     return CondBr;
   }
+  case VPInstruction::ComputeReductionResult: {
+    if (Part != 0)
+      return State.get(
+          this, VPIteration(State.UF - 1, VPLane::getLastLaneForVF(State.VF)));
+
+    auto *PhiR = dyn_cast<VPReductionPHIRecipe>(getOperand(0));
+    auto *OrigPhi = cast<PHINode>(PhiR->getUnderlyingValue());
+    // Get it's reduction variable descriptor.
+    const RecurrenceDescriptor &RdxDesc = PhiR->getRecurrenceDescriptor();
----------------
ayalz wrote:

-- which exacerbates the undesired issue of implicit cross-recipe dependences. Please add a FIXME to emphasize that this is an intermediate situation to support gradual refactoring, possibly also clarifying at the summary that, rather than `The recipe may be broken down further in the future` - it must be.

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


More information about the llvm-commits mailing list