[PATCH] D65544: [RLEV] Rewrite loop exit values for multiple exit loops w/o overall loop exit count

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 13:11:49 PDT 2019


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM as a starting point.

I don't really have a good idea on how to expose something like getSCEVAtExit() without duplicating a lot of getSCEVAtScope() logic. We could add an extra BB argument to further narrow the scope, but I don't think that will mesh well with the caching.



================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:614
       for (unsigned i = 0; i != NumPreds; ++i) {
         // If the value being merged in is not integer or is not defined
         // in the loop, skip it.
----------------
Unrelated: "not integer" probably supposed to be "not an instruction"?


================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:640
+          // TODO: This should probably be sunk into SCEV in some way; maybe a
+          // getSCEVForExit(SCEV*, L, ExitingBB)?  It can be generlized for
+          // most SCEV expressions and other recurance types (e.g. shift
----------------
nit: generalized


================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:641
+          // getSCEVForExit(SCEV*, L, ExitingBB)?  It can be generlized for
+          // most SCEV expressions and other recurance types (e.g. shift
+          // recurrances).  Is there existing code we can reuse?
----------------
nit: recurrence


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65544/new/

https://reviews.llvm.org/D65544





More information about the llvm-commits mailing list