[PATCH] D39286: [SCEV][NFC] Introduce isSignedDivisorOf function in SCEV

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 04:21:07 PDT 2017


mkazantsev added a comment.

The general idea is that I plan to factor out concept of SCEV range (which is basically a tripple `Begin, End, Step`) into an utility class. The concept of such range is used in IRCE, Loop Predication and some other passes, each of them has its own implementation of basic stuff (such as intersection, contains check etc).

As one of pieces of this work, I want to implement intersection of ranges with step different from 1. At least we can handle simple cases: for example intersection of range `Begin = 0, End = 100, Step = 5` and range `Begin = 0, End = 100, Step = 10` is `Begin = 0, End = 100, Step = 10`.

This particular function (and its unsigned analogue) will be used like following: given 2 ranges with steps `S1` and `S2`, and `S1` divides by `S2`, and both `Begin1, Begin2` have the same remainder mod `S1`, then their intersection is a range with `Begin = max(Begin1, Begin2)` and `Step = S1`.

I'm ok with this patch to not be merged until its application is implemented.


https://reviews.llvm.org/D39286





More information about the llvm-commits mailing list