[PATCH] D39082: [IRCE] Smarter detection of empty ranges using SCEV

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 23:16:09 PDT 2017


mkazantsev added inline comments.


================
Comment at: test/Transforms/IRCE/empty_ranges.ll:9
+; The intersection with safe iteration space is the empty range [60, 10).
+; It is better to eliminate one range check than attempt to eliminate both given
+; that we will never go to the main loop in the latter case and basically
----------------
mkazantsev wrote:
> anna wrote:
> > So, in this case, from now on, only the first range check is removed, i.e. we will not remove range checks where the safe iteration space intersected with the "true" iteration space is empty. By true iteration space, I mean, the set where the guard is always true.
> That was the intension. Checks in pre- and postloop are not eliminated, and if the safe iteration space is empty, we will never get to the mainloop (where something was removed). Removing at least something from the main loop which remains reachable may be good by itself. For example, if there was a load between range checks 1 and 2, we can now correctly hoist it out of the main loop because it becomes guaranteed to execute now.
For example, if the 2nd range check wasn't leaving the loop, the transform would also be profitable.


https://reviews.llvm.org/D39082





More information about the llvm-commits mailing list