Skip to content

Commit 991a621

Browse files
authored
[TargetLowering] Remove weird use of MVT::isVoid in an assert. (#101436)
At the time this was written there were no vector types in MVT. The order was: -scalar integer types -scalar FP types -isVoid I believe this isVoid check was to catch walking off the end of the scalar FP types. While the isInteger()==isInteger caught walking off the end of scalar integer types. These days we have: -scalar integer types -scalar FP types -fixed vector integer types -fixed vector FP types -scalable vector integer types -scalable vector FP types. -Glue -isVoid So checking isVoid doesn't detect what it used to. I've changed it to check isFloatingPoint() == isFloatingPoint() instead.
1 parent 27b6080 commit 991a621

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,8 @@ class TargetLoweringBase {
16401640
MVT NVT = VT;
16411641
do {
16421642
NVT = (MVT::SimpleValueType)(NVT.SimpleTy+1);
1643-
assert(NVT.isInteger() == VT.isInteger() && NVT != MVT::isVoid &&
1643+
assert(NVT.isInteger() == VT.isInteger() &&
1644+
NVT.isFloatingPoint() == VT.isFloatingPoint() &&
16441645
"Didn't find type to promote to!");
16451646
} while (VTBits >= NVT.getScalarSizeInBits() || !isTypeLegal(NVT) ||
16461647
getOperationAction(Op, NVT) == Promote);

0 commit comments

Comments
 (0)