[PATCH] D147355: [LV] Optimize trip count SCEV.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 10:35:43 PDT 2023


reames requested changes to this revision.
reames added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:1005
+        SE.getAddExpr(BackedgeTakenCount,
+                      SE.getOne(BackedgeTakenCount->getType()), SCEV::FlagNUW),
+        IdxTy);
----------------
I don't believe the flags usage here is correct.  There's a single SCEV node for an add with given operands.  The flags must be correct for all users of that add expression, and for a loop invariant trip count there's nothing preventing another use outside the loop which does overflow.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147355



More information about the llvm-commits mailing list