aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ConstantFold.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-03-11 14:30:02 +0100
committerNikita Popov <npopov@redhat.com>2022-03-11 14:30:02 +0100
commit7781f61efa1823faadf73819785b8b8acd288914 (patch)
treeeaed89d83a5936cf7d971c4eead595f8551e75cf /llvm/lib/IR/ConstantFold.cpp
parent853beb55e14615ade795e18d218305c1dfdb5181 (diff)
downloadllvm-7781f61efa1823faadf73819785b8b8acd288914.zip
llvm-7781f61efa1823faadf73819785b8b8acd288914.tar.gz
llvm-7781f61efa1823faadf73819785b8b8acd288914.tar.bz2
[ConstantFold] Fix scalable shufflevector fold with all-undef mask
If the input is scalable, we should not be returning a fixed-width vector as a result.
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
-rw-r--r--llvm/lib/IR/ConstantFold.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index 936b1fc..74200b9 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -724,7 +724,7 @@ Constant *llvm::ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2,
// Undefined shuffle mask -> undefined value.
if (all_of(Mask, [](int Elt) { return Elt == UndefMaskElem; })) {
- return UndefValue::get(FixedVectorType::get(EltTy, MaskNumElts));
+ return UndefValue::get(VectorType::get(EltTy, MaskEltCount));
}
// If the mask is all zeros this is a splat, no need to go through all