Skip to content

Commit 72233a2

Browse files
committed
Fix
1 parent f7e1482 commit 72233a2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ tryAdjustICmpImmAndPred(Register RHS, CmpInst::Predicate P,
614614
// x uge c => x ugt c - 1
615615
//
616616
// When c is not zero.
617-
assert(C != 0 && "Expected non-zero unsigned immediate");
617+
assert(C != 0 && "C should not be zero here!");
618618
P = (P == CmpInst::ICMP_ULT) ? CmpInst::ICMP_ULE : CmpInst::ICMP_UGT;
619619
C -= 1;
620620
break;
@@ -639,10 +639,7 @@ tryAdjustICmpImmAndPred(Register RHS, CmpInst::Predicate P,
639639
// x ule c => x ult c + 1
640640
// x ugt c => s uge c + 1
641641
//
642-
// When c is not the largest possible unsigned integer.
643-
if ((Size == 32 && static_cast<uint32_t>(C) == UINT32_MAX) ||
644-
(Size == 64 && C == UINT64_MAX))
645-
return std::nullopt;
642+
assert(C != (Size == 32 ? UINT32_MAX : UINT64_MAX) && "C should not be -1 here!");
646643
P = (P == CmpInst::ICMP_ULE) ? CmpInst::ICMP_ULT : CmpInst::ICMP_UGE;
647644
C += 1;
648645
break;

0 commit comments

Comments
 (0)