[PATCH] D129643: [SCEV] Use context to strengthen flags of BinOps

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 13:55:05 PDT 2022


apilipenko accepted this revision.
apilipenko added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:2330
+    return false;
+  // TODO: Support other operations.
+  if (BinOp != Instruction::Add)
----------------
Maybe add a comment explaining the pattern you are looking for here?

Something like: "We can prove that add(x, constant) doesn't wrap if isKnownPredicateAt can guarantee that x <= max_int - constant at the given context."


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

https://reviews.llvm.org/D129643



More information about the llvm-commits mailing list