aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringBase.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2025-06-16 10:04:28 -0700
committerGitHub <noreply@github.com>2025-06-16 10:04:28 -0700
commita733c6c7bb1c533ec28c96c49d3c5de7babd8b7f (patch)
tree48f17af96365c65b7c901eb18de8d4d856890eac /llvm/lib/CodeGen/TargetLoweringBase.cpp
parent20a1b357c0ff3c3f71de45bae42cb2dead7b66c9 (diff)
downloadllvm-a733c6c7bb1c533ec28c96c49d3c5de7babd8b7f.zip
llvm-a733c6c7bb1c533ec28c96c49d3c5de7babd8b7f.tar.gz
llvm-a733c6c7bb1c533ec28c96c49d3c5de7babd8b7f.tar.bz2
[TargetLowering][RISCV] Allow scalable non-simple EVTs to be split even if the element type isn't a legal scalar type. (#144007)
This fixes an inconsistency in i64 vector handling between RV32 and RV64. Even if i64 isn't legal as a scalar, we should still be able to split a large i64 vector to get down to a legal vector type. We only need to give up if we need to split a vscale x 1 vector.
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringBase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index 935afaf..b1afdc2 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -1030,7 +1030,7 @@ TargetLoweringBase::getTypeConversion(LLVMContext &Context, EVT VT) const {
// If type is to be expanded, split the vector.
// <4 x i140> -> <2 x i140>
if (LK.first == TypeExpandInteger) {
- if (VT.getVectorElementCount().isScalable())
+ if (NumElts.isScalable() && NumElts.getKnownMinValue() == 1)
return LegalizeKind(TypeScalarizeScalableVector, EltVT);
return LegalizeKind(TypeSplitVector,
VT.getHalfNumVectorElementsVT(Context));