[llvm] [VPlan] Unroll VPReplicateRecipe by VF. (PR #142433)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 9 08:37:34 PDT 2025


================
@@ -493,6 +493,9 @@ Value *VPInstruction::generate(VPTransformState &State) {
   }
   case Instruction::ExtractElement: {
     assert(State.VF.isVector() && "Only extract elements from vectors");
+    return State.get(getOperand(0),
+                     VPLane(cast<ConstantInt>(getOperand(1)->getLiveInIRValue())
+                                ->getZExtValue()));
----------------
ayalz wrote:

```suggestion
    auto ElementToExtract = cast<ConstantInt>(getOperand(1)->getLiveInIRValue())->getZExtValue());
    return State.get(getOperand(0), VPLane(ElementToExtract));
```

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


More information about the llvm-commits mailing list