[llvm] [ConstraintElim] Bound non-increasing header IVs by start value. (PR #217921)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 22 06:43:16 PDT 2026
================
@@ -1134,9 +1158,10 @@ void State::addInfoForInductions(BasicBlock &BB) {
WorkList.push_back(FactOrCheck::getConditionFact(
DTN, CmpInst::ICMP_UGE, StartValue, PN,
ConditionTy(CmpInst::ICMP_ULE, B, StartValue)));
- WorkList.push_back(FactOrCheck::getConditionFact(
- DTN, CmpInst::ICMP_SGE, StartValue, PN,
- ConditionTy(CmpInst::ICMP_SLE, B, StartValue)));
+ if (!(Info.Decreasing && Info.Signed))
----------------
fhahn wrote:
This should avoid adding the same fact again, as it should already be added without precondition in `addBoundsForHeaderInductions`.
The case where we needed to add with precondition was missing; I added 2 more tests.
https://github.com/llvm/llvm-project/pull/217921
More information about the llvm-commits
mailing list