[PATCH] D116747: [SCEVExpand] Only create required predicate checks.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 6 10:04:18 PST 2022


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


================
Comment at: llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:2520
   Value *Add = nullptr, *Sub = nullptr;
+  bool NeedPosCheck = SE.isKnownPositive(Step) || !SE.isKnownNegative(Step);
+  bool NeedNegCheck = !SE.isKnownPositive(Step) || SE.isKnownNegative(Step);
----------------
reames wrote:
> These checks seem redundant.  You should be able to use !isKnownNegative and !isKnownPositive unless I'm missing something?
Thanks, I simplified the checks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116747



More information about the llvm-commits mailing list