[llvm] [LV][EVL]Support reversed loads/stores. (PR #88025)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 23 13:08:59 PDT 2024
================
@@ -9459,7 +9464,14 @@ void VPWidenStoreEVLRecipe::execute(VPTransformState &State) {
CallInst *NewSI = nullptr;
Value *StoredVal = State.get(StoredValue, 0);
Value *EVL = State.get(getEVL(), VPIteration(0, 0));
- // FIXME: Support reverse store after vp_reverse is added.
+ if (isReverse()) {
+ auto *StoredValTy = cast<VectorType>(StoredVal->getType());
+ Value *MaskVal = Builder.CreateVectorSplat(StoredValTy->getElementCount(),
+ Builder.getTrue());
+ StoredVal = Builder.CreateIntrinsic(
+ StoredValTy, Intrinsic::experimental_vp_reverse,
+ {StoredVal, MaskVal, EVL}, nullptr, "vp.reverse");
+ }
Value *Mask = getMask()
----------------
fhahn wrote:
I think the mask also needs reversing here, same as for loads?
https://github.com/llvm/llvm-project/pull/88025
More information about the llvm-commits
mailing list