Skip to content

Commit 3d7ccc1

Browse files
!fixup use assert instead of unreachable
1 parent e9e22e0 commit 3d7ccc1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/lib/CodeGen/GlobalISel/Utils.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,18 +1164,16 @@ LLT llvm::getGCDType(LLT OrigTy, LLT TargetTy) {
11641164

11651165
if (OrigTy.isVector() && TargetTy.isVector()) {
11661166
LLT OrigElt = OrigTy.getElementType();
1167-
LLT TargetElt = TargetTy.getElementType();
11681167

11691168
// TODO: The docstring for this function says the intention is to use this
11701169
// function to build MERGE/UNMERGE instructions. It won't be the case that
11711170
// we generate a MERGE/UNMERGE between fixed and scalable vector types. We
11721171
// could implement getGCDType between the two in the future if there was a
11731172
// need, but it is not worth it now as this function should not be used in
11741173
// that way.
1175-
if ((OrigTy.isScalableVector() && TargetTy.isFixedVector()) ||
1176-
(OrigTy.isFixedVector() && TargetTy.isScalableVector()))
1177-
llvm_unreachable(
1178-
"getGCDType not implemented between fixed and scalable vectors.");
1174+
assert(((OrigTy.isScalableVector() && !TargetTy.isFixedVector()) ||
1175+
(OrigTy.isFixedVector() && !TargetTy.isScalableVector())) &&
1176+
"getGCDType not implemented between fixed and scalable vectors.");
11791177

11801178
unsigned GCD = std::gcd(OrigTy.getSizeInBits().getKnownMinValue(),
11811179
TargetTy.getSizeInBits().getKnownMinValue());

0 commit comments

Comments
 (0)