[llvm] [IA][RISCV] Add support for vp.load/vp.store with shufflevector (PR #135445)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 24 04:30:32 PDT 2025
================
@@ -339,25 +371,48 @@ bool InterleavedAccessImpl::lowerInterleavedLoad(
return false;
bool BinOpShuffleChanged =
- replaceBinOpShuffles(BinOpShuffles.getArrayRef(), Shuffles, LI);
-
- LLVM_DEBUG(dbgs() << "IA: Found an interleaved load: " << *LI << "\n");
+ replaceBinOpShuffles(BinOpShuffles.getArrayRef(), Shuffles, LoadOp);
+
+ // Check if the de-interleaved vp.load masks are the same.
+ unsigned ShuffleMaskLen = Shuffles[0]->getShuffleMask().size();
+ SmallVector<Constant *, 8> LaneMask(ShuffleMaskLen, nullptr);
+ if (auto *VPLoad = dyn_cast<VPIntrinsic>(LoadOp)) {
+ if (!isInterleavedConstantMask(
+ Factor, cast<ConstantVector>(VPLoad->getArgOperand(1)), LaneMask))
+ return false;
----------------
lukel97 wrote:
This is the same check as `getMask` used by `lowerDeinterleaveIntrinsic` right? Can we move `isInterleavedConstantMask` in there to handle ConstantVectors instead?
https://github.com/llvm/llvm-project/pull/135445
More information about the llvm-commits
mailing list