@@ -1415,7 +1415,7 @@ static std::optional<bool> checkCondition(CmpInst::Predicate Pred, Value *A,
1415
1415
}
1416
1416
1417
1417
static bool checkAndReplaceCondition (
1418
- CmpInst *Cmp, ConstraintInfo &Info, unsigned NumIn, unsigned NumOut,
1418
+ ICmpInst *Cmp, ConstraintInfo &Info, unsigned NumIn, unsigned NumOut,
1419
1419
Instruction *ContextInst, Module *ReproducerModule,
1420
1420
ArrayRef<ReproducerEntry> ReproducerCondStack, DominatorTree &DT,
1421
1421
SmallVectorImpl<Instruction *> &ToRemove) {
@@ -1448,6 +1448,14 @@ static bool checkAndReplaceCondition(
1448
1448
checkCondition (Cmp->getPredicate (), Cmp->getOperand (0 ),
1449
1449
Cmp->getOperand (1 ), Cmp, Info))
1450
1450
return ReplaceCmpWithConstant (Cmp, *ImpliedCondition);
1451
+
1452
+ if (Cmp->hasSameSign () && Cmp->isRelational ()) {
1453
+ if (auto ImpliedCondition =
1454
+ checkCondition (Cmp->getFlippedSignednessPredicate (),
1455
+ Cmp->getOperand (0 ), Cmp->getOperand (1 ), Cmp, Info))
1456
+ return ReplaceCmpWithConstant (Cmp, *ImpliedCondition);
1457
+ }
1458
+
1451
1459
return false ;
1452
1460
}
1453
1461
0 commit comments