[PATCH] D85046: [SCEV] If Start >= RHS, simplify (Start smin RHS) to RHS for trip counts (PR46924, PR46939)

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 2 22:01:11 PDT 2020


mkazantsev added a comment.

Seems that SCEV simplification is unable to exploit this fact when computing minimum. I think the right place to fix this is inside getMinExpr.



================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:10636
+    else
+      End = IsSigned ? getSMinExpr(RHS, Start) : getUMinExpr(RHS, Start);
+  }
----------------
If loop is guarded by condition `Start >= RHS`, then `getMinExpr(RHS, Start)` should be able to simplify to `RHS`. Seems that we are missing some simplifications in there. Can we improve the simplification instead of manually handling this particular case here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85046



More information about the llvm-commits mailing list