[llvm] [VPlan] Extract reverse operation for reverse accesses (PR #146525)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 31 02:36:20 PDT 2025
================
@@ -917,6 +918,8 @@ Value *VPInstruction::generate(VPTransformState &State) {
return Res;
}
+ case VPInstruction::Reverse:
+ return Builder.CreateVectorReverse(State.get(getOperand(0)), "reverse");
----------------
lukel97 wrote:
> VPInstruction::Reverse itself doesn't appear to rely on the runtime VF.
But the fact that we need to transform a VPInstruction::Reverse to a experimental.vp.reverse for it to be correct with EVL tail folding, to me feels that it actually does depend on the runtime VF.
I.e. VPInstruction::Reverse should really always be a experimental.vp.reverse that we just happen to optimise to a plain `Builder.CreateVectorReverse` when the VF operand = Plan.getVF
https://github.com/llvm/llvm-project/pull/146525
More information about the llvm-commits
mailing list