[PATCH] D58881: [Transform] Improve fold of sadd.with.overflow

Dan Robertson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 2 18:24:43 PST 2019


dlrobertson marked 2 inline comments as done.
dlrobertson added a comment.

Comments and feedback would be very much appreciated. I did my best to follow https://llvm.org/docs/Contributing.html and https://llvm.org/docs/Phabricator.html, but I might have missed something. Please let me know if I did.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2046
+    //
+    // FIXME: Add the last case.
+    Value *X = nullptr;
----------------
I was not entirely sure how to solve the last case. `sadd.with.overflow` returns an aggregate, while `add nsw` does not. I was not sure how to construct the aggregate, so I did not address the last case in my first attempt.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2072
 
   case Intrinsic::usub_with_overflow:
   case Intrinsic::ssub_with_overflow: {
----------------
This should be similar, but since I'm *very* new to LLVM, I'd like to keep this diff as small in scope as possible. I'd like to address `uadd.with.overflow` in a follow-up.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58881





More information about the llvm-commits mailing list