File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -359,22 +359,21 @@ bool TypePromotionImpl::isSafeWrap(Instruction *I) {
359
359
if (!OverflowConst.isNonPositive ())
360
360
return false ;
361
361
362
+ SafeWrap.insert (I);
363
+
362
364
// Using C1 = OverflowConst and C2 = ICmpConst, we can either prove that:
363
365
// zext(x) + sext(C1) <u zext(C2) if C1 < 0 and C1 >s C2
364
366
// zext(x) + sext(C1) <u sext(C2) if C1 < 0 and C1 <=s C2
365
367
if (OverflowConst.sgt (ICmpConst)) {
366
368
LLVM_DEBUG (dbgs () << " IR Promotion: Allowing safe overflow for sext "
367
369
<< " 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);
375
370
return true ;
376
371
}
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 ;
378
377
}
379
378
380
379
bool TypePromotionImpl::shouldPromote (Value *V) {
You can’t perform that action at this time.
0 commit comments