[llvm] [VPlan] Introduce ComputeReductionResult VPInstruction opcode. (PR #70253)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 26 05:59:58 PDT 2023
================
@@ -403,6 +404,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));
+ PHINode *OrigPhi = cast<PHINode>(PhiR->getUnderlyingValue());
----------------
alexey-bataev wrote:
```suggestion
auto *OrigPhi = cast<PHINode>(PhiR->getUnderlyingValue());
```
https://github.com/llvm/llvm-project/pull/70253
More information about the llvm-commits
mailing list