[PATCH] D126502: [SCEV] Apply conditions involving constants first in applyLoopGuards.

Alon Kom via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 28 23:22:45 PDT 2022


alonkom added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:14554
+  // effective expression rewriting.
+  stable_sort(Terms, [this](const std::pair<Value *, bool> &A,
+                            const std::pair<Value *, bool> &B) {
----------------
Even with this sorting won't we lose information about the min/max values of the value?
For example if we know (tc > 0) and (tc % 8 == 0) and we process (tc % 8 == 0) last, AFAIU the SCEV expression will be overridden to (tc / 8) * 8 and we'll lose the fact that the trip count is also positive.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126502



More information about the llvm-commits mailing list