aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/InterleavedAccessPass.cpp
diff options
context:
space:
mode:
authorDavid Sherwood <david.sherwood@arm.com>2025-09-03 10:55:39 +0100
committerGitHub <noreply@github.com>2025-09-03 10:55:39 +0100
commit7da91fa801d8bd490c8dcd9a29faba209feb2954 (patch)
treeeccbdf00ce76ae22066239a48dc6910fd78bea41 /llvm/lib/CodeGen/InterleavedAccessPass.cpp
parentb16930204b230240d834f667c8f32b12ca4ad198 (diff)
downloadllvm-7da91fa801d8bd490c8dcd9a29faba209feb2954.zip
llvm-7da91fa801d8bd490c8dcd9a29faba209feb2954.tar.gz
llvm-7da91fa801d8bd490c8dcd9a29faba209feb2954.tar.bz2
[CodeGen] Fix failing assert in interleaved access pass (#156457)
In the InterleavedAccessPass the function getMask assumes that shufflevector operations are always fixed width, which isn't true because we use them for splats of scalable vectors. This patch fixes the code by bailing out for scalable vectors.
Diffstat (limited to 'llvm/lib/CodeGen/InterleavedAccessPass.cpp')
-rw-r--r--llvm/lib/CodeGen/InterleavedAccessPass.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/InterleavedAccessPass.cpp b/llvm/lib/CodeGen/InterleavedAccessPass.cpp
index c5e9703..e3ded12 100644
--- a/llvm/lib/CodeGen/InterleavedAccessPass.cpp
+++ b/llvm/lib/CodeGen/InterleavedAccessPass.cpp
@@ -660,6 +660,10 @@ static std::pair<Value *, APInt> getMask(Value *WideMask, unsigned Factor,
}
if (auto *SVI = dyn_cast<ShuffleVectorInst>(WideMask)) {
+ Type *Op1Ty = SVI->getOperand(1)->getType();
+ if (!isa<FixedVectorType>(Op1Ty))
+ return {nullptr, GapMask};
+
// Check that the shuffle mask is: a) an interleave, b) all of the same
// set of the elements, and c) contained by the first source. (c) could
// be relaxed if desired.