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

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 02:32:30 PDT 2025


================
@@ -917,6 +918,8 @@ Value *VPInstruction::generate(VPTransformState &State) {
 
     return Res;
   }
+  case VPInstruction::Reverse:
+    return Builder.CreateVectorReverse(State.get(getOperand(0)), "reverse");
----------------
Mel-Chen wrote:

It would be nice if VPInstruction::Reverse had a VF operand for us. 
However, unlike VPVectorEndPointerRecipe, which uses the runtime VF in ::execute — providing a strong reason for having a VF operand — VPInstruction::Reverse itself doesn't appear to rely on the runtime VF. So, we probably need a stronger reason to justify adding a VF operand to VPInstruction::Reverse.

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


More information about the llvm-commits mailing list