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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 1 13:39:35 PST 2024


================
@@ -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)));
----------------
fhahn wrote:

Updated to support ComputeReductionResult in isUniformAfterVectorization and removed the manual setting of values.

> BTW, VPFirstOrderRecurrencePHIRecipe::execute() sets only the first Part, perhaps it should do so under an if Part == 0?
Not sure if this applies here, as the `execute` doesn't iterate over the parts (compared to VPInstruction::generate which generates code for a single part (and the iteration over parts is controlled in the caller)

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


More information about the llvm-commits mailing list