Skip to content

Commit 33c92a0

Browse files
committed
test
1 parent d1a7225 commit 33c92a0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ static std::optional<bool> checkCondition(CmpInst::Predicate Pred, Value *A,
14151415
}
14161416

14171417
static bool checkAndReplaceCondition(
1418-
CmpInst *Cmp, ConstraintInfo &Info, unsigned NumIn, unsigned NumOut,
1418+
ICmpInst *Cmp, ConstraintInfo &Info, unsigned NumIn, unsigned NumOut,
14191419
Instruction *ContextInst, Module *ReproducerModule,
14201420
ArrayRef<ReproducerEntry> ReproducerCondStack, DominatorTree &DT,
14211421
SmallVectorImpl<Instruction *> &ToRemove) {
@@ -1448,6 +1448,14 @@ static bool checkAndReplaceCondition(
14481448
checkCondition(Cmp->getPredicate(), Cmp->getOperand(0),
14491449
Cmp->getOperand(1), Cmp, Info))
14501450
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+
14511459
return false;
14521460
}
14531461

0 commit comments

Comments
 (0)