[llvm] [LV][EVL]Support reversed loads/stores. (PR #88025)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 24 14:03:26 PDT 2024
================
@@ -9398,7 +9399,14 @@ void VPWidenLoadEVLRecipe::execute(VPTransformState &State) {
NewLI->addParamAttr(
0, Attribute::getWithAlignment(NewLI->getContext(), Alignment));
State.addMetadata(NewLI, LI);
- State.set(this, NewLI, 0);
+ Instruction *Res = NewLI;
+ if (isReverse()) {
+ Value *MaskVal =
+ Builder.CreateVectorSplat(DataTy->getElementCount(), Builder.getTrue());
+ Res = Builder.CreateIntrinsic(DataTy, Intrinsic::experimental_vp_reverse,
+ {Res, MaskVal, EVL}, nullptr, "vp.reverse");
+ }
----------------
ayalz wrote:
The values were loaded into `Res` under (possibly partial) `Mask`, should they also be reversed under (possibly reversed) Mask, rather than under an all-true mask?
If the latter, can it be reused:
```suggestion
if (isReverse())
Res = Builder.CreateIntrinsic(DataTy, Intrinsic::experimental_vp_reverse,
{Res, AllTrueMask, EVL}, nullptr, "vp.reverse");
```
https://github.com/llvm/llvm-project/pull/88025
More information about the llvm-commits
mailing list