diff options
author | Philip Reames <preames@rivosinc.com> | 2025-07-22 15:21:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-22 15:21:26 -0700 |
commit | 2e2a8992f992b185483bb1b120b30eacb30700ca (patch) | |
tree | fca88527e672bce6ac51793ab69672ba47a3ecb3 /llvm/lib/CodeGen | |
parent | efbe98db0029a97109ec0b4db51f46af1ce8e581 (diff) | |
download | llvm-2e2a8992f992b185483bb1b120b30eacb30700ca.zip llvm-2e2a8992f992b185483bb1b120b30eacb30700ca.tar.gz llvm-2e2a8992f992b185483bb1b120b30eacb30700ca.tar.bz2 |
[IA] Remove resriction on constant masks for shuffle lowering (#150098)
The point of this change is simply to show that the constant check was
not required for correctness. The mixed intrinsic and shuffle tests are
added purely to exercise the code. An upcoming change will add support
for shuffle matching in getMask to support non-constant fixed vector
cases.
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/InterleavedAccessPass.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/InterleavedAccessPass.cpp b/llvm/lib/CodeGen/InterleavedAccessPass.cpp index df162fc..1298aea 100644 --- a/llvm/lib/CodeGen/InterleavedAccessPass.cpp +++ b/llvm/lib/CodeGen/InterleavedAccessPass.cpp @@ -268,17 +268,9 @@ bool InterleavedAccessImpl::lowerInterleavedLoad( if (isa<ScalableVectorType>(Load->getType())) return false; - if (auto *LI = dyn_cast<LoadInst>(Load)) { - if (!LI->isSimple()) - return false; - } else if (auto *VPLoad = dyn_cast<VPIntrinsic>(Load)) { - assert(VPLoad->getIntrinsicID() == Intrinsic::vp_load); - // Require a constant mask. - if (!isa<ConstantVector>(VPLoad->getMaskParam())) - return false; - } else { - llvm_unreachable("unsupported load operation"); - } + if (auto *LI = dyn_cast<LoadInst>(Load); + LI && !LI->isSimple()) + return false; // Check if all users of this load are shufflevectors. If we encounter any // users that are extractelement instructions or binary operators, we save @@ -497,9 +489,6 @@ bool InterleavedAccessImpl::lowerInterleavedStore( StoredValue = SI->getValueOperand(); } else if (auto *VPStore = dyn_cast<VPIntrinsic>(Store)) { assert(VPStore->getIntrinsicID() == Intrinsic::vp_store); - // Require a constant mask. - if (!isa<ConstantVector>(VPStore->getMaskParam())) - return false; StoredValue = VPStore->getArgOperand(0); } else { llvm_unreachable("unsupported store operation"); |