[PATCH] D147117: [SCEV] When computing trip count, only zext if necessary

Joshua Cao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 30 22:51:24 PDT 2023


caojoshua marked an inline comment as done.
caojoshua added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:8047
+  const SCEV *One = getOne(ExitCountType);
+  if (!Extend || willNotOverflow(Instruction::Add, false, ExitCount, One))
+    return getAddExpr(ExitCount, One);
----------------
nikic wrote:
> I'd prefer this to go back to the previous version. willNotOverflow() is very expensive and not needed here.
I reverted back to previous version. I can see that willNotOverflow() is a bit overkill here. @reames what do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147117



More information about the llvm-commits mailing list