[llvm] [LV][EVL]Support reversed loads/stores. (PR #88025)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 01:40:08 PDT 2024


================
@@ -9382,9 +9373,19 @@ void VPWidenLoadEVLRecipe::execute(VPTransformState &State) {
   CallInst *NewLI;
   Value *EVL = State.get(getEVL(), VPIteration(0, 0));
   Value *Addr = State.get(getAddr(), 0, !CreateGather);
-  Value *Mask =
-      getMask() ? State.get(getMask(), 0)
-                : Mask = Builder.CreateVectorSplat(State.VF, Builder.getTrue());
+  Value *Mask = getMask()
+                    ? State.get(getMask(), 0)
+                    : Builder.CreateVectorSplat(State.VF, Builder.getTrue());
+  if (isReverse() && getMask()) {
+    VectorType *MaskTy = cast<VectorType>(Mask->getType());
----------------
fhahn wrote:

The newly added test only seems to cover stores with masks, could you add one with loads that need a mask as well?

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


More information about the llvm-commits mailing list