[llvm] [VPlan] Extract reverse operation for reverse accesses (PR #146525)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 08:08:04 PDT 2025


================
@@ -1104,6 +1107,13 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
                                   I32Ty, {Arg0Ty, I32Ty, I1Ty});
     return Ctx.TTI.getIntrinsicInstrCost(Attrs, Ctx.CostKind);
   }
+  case VPInstruction::Reverse: {
+    assert(VF.isVector() && "Reverse operation must be vector type");
+    Type *VectorTy = toVectorTy(Ctx.Types.inferScalarType(this), VF);
----------------
artagnon wrote:

```suggestion
    Type *VectorTy = toVectorTy(Ctx.Types.inferScalarType(getOperand(0)), VF);
```

?

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


More information about the llvm-commits mailing list