Skip to content

Commit d0a1bf8

Browse files
committed
[TypePromotion] Remove an unreachable 'return false'. NFC
The if and the else above this both return so this is unreachable. Delete it and remove the else after return.
1 parent c1a99b2 commit d0a1bf8

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

llvm/lib/CodeGen/TypePromotion.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,22 +359,21 @@ bool TypePromotionImpl::isSafeWrap(Instruction *I) {
359359
if (!OverflowConst.isNonPositive())
360360
return false;
361361

362+
SafeWrap.insert(I);
363+
362364
// Using C1 = OverflowConst and C2 = ICmpConst, we can either prove that:
363365
// zext(x) + sext(C1) <u zext(C2) if C1 < 0 and C1 >s C2
364366
// zext(x) + sext(C1) <u sext(C2) if C1 < 0 and C1 <=s C2
365367
if (OverflowConst.sgt(ICmpConst)) {
366368
LLVM_DEBUG(dbgs() << "IR Promotion: Allowing safe overflow for sext "
367369
<< "const of " << *I << "\n");
368-
SafeWrap.insert(I);
369-
return true;
370-
} else {
371-
LLVM_DEBUG(dbgs() << "IR Promotion: Allowing safe overflow for sext "
372-
<< "const of " << *I << " and " << *CI << "\n");
373-
SafeWrap.insert(I);
374-
SafeWrap.insert(CI);
375370
return true;
376371
}
377-
return false;
372+
373+
LLVM_DEBUG(dbgs() << "IR Promotion: Allowing safe overflow for sext "
374+
<< "const of " << *I << " and " << *CI << "\n");
375+
SafeWrap.insert(CI);
376+
return true;
378377
}
379378

380379
bool TypePromotionImpl::shouldPromote(Value *V) {

0 commit comments

Comments
 (0)