SCEV should be able to prove facts like x <u x+1<nuw>.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Disregard. We return true if the predicate is known-true, and false in all other cases.
Looks reasonable to me.
llvm/lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
9322–9323 | It is unclear how much it matters in practice, but | |
9331 | Likely even less real-world, but likewise, i'd think we want to check |
llvm/lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
9322–9323 | I think such cases are handled in different aux functions of isKnownViaNonRecursiveReasoning. This one is specifically for constant offset. |
Reloaded with dedicated unit test to make it independent on underlying patches (the only dependency was test).
It is unclear how much it matters in practice, but
i don't think C needs to be a constant,
which means that we only need to check that RHS is an NUW SCEVAddExpr, and that
any_of(AE->operands(), [L](SCEV*Op){ return Op == L; }).