Page MenuHomePhabricator

[SCEV] Use unsigned/signed intersection type in SCEV

Authored by nikic on Mar 30 2019, 2:22 PM.



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.

Diff Detail


Event Timeline

nikic created this revision.Mar 30 2019, 2:22 PM

Would be good to add a test demonstrating what this allows to handle.

nikic added a comment.Mar 31 2019, 2:14 PM

@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.

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.

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.

sanjoy accepted this revision.Jun 14 2019, 7:13 PM


This revision is now accepted and ready to land.Jun 14 2019, 7:13 PM
This revision was automatically updated to reflect the committed changes.