Based on D59959, this switches SCEV to use unsigned/signed range intersection based on the sign hint. This will prefer non-wrapping ranges in the relevant domain. I've left the one intersection in getRangeForAffineAR() to use the smallest intersect heuristic, as there doesn't seem to be any obvious preference there.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
@lebedev.ri I don't really have any particular goal or previously failing case in mind here. The test changes show that this allows us to infer a few more nowrap flags and makes some signed/unsigned ranges non-wrapping. The changes seem like improvements to me, though I'm a bit unsure about increasing-or-decreasing-iv.ll.
Comment Actions
Someone knowledged in SCEV will need to review this.
I still think that at least one test, that shows some new fold that is now possible thanks to this, is needed.
Comment Actions
I'm not sure who can review SCEV patches nowadays? No activity from @mkazantsev for a while.
Can rubber-stamp this since it looks trivial/correct, but i don't have the inside knowledge.