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

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 6 07:55:58 PST 2022


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


================
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);
----------------
These checks seem redundant.  You should be able to use !isKnownNegative and !isKnownPositive unless I'm missing something?


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