[PATCH] D60668: [IR] Add WithOverflowInst class

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 14 23:47:06 PDT 2019


lebedev.ri added a comment.

Looks reasonable (hard to tell with large diffs).
I'm not sure if that's all it takes, so would be good for someone else to look through.



================
Comment at: llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp:403
+static bool willNotOverflow(WithOverflowInst *WO, LazyValueInfo *LVI) {
+  // TODO Also support multiplication.
+  Instruction::BinaryOps BinOp = WO->getBinaryOp();
----------------
I'm not sure what is the prevalent pattern in LLVM, but t'm reasonably sure it's `TODO:`, `FIXME:` in general.


================
Comment at: llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp:421
+static void processOverflowIntrinsic(WithOverflowInst *WO) {
+  // TODO A CreateBinOp() that accepts NUW/NSW could simplify this code.
+  IRBuilder<> B(WO);
----------------
There were some setters in `Instruction`(?) that allowed to operate on NSW / NUW flags.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60668





More information about the llvm-commits mailing list