[PATCH] D60061: [InstCombine] ssubo X, C -> saddo X, -C

Dan Robertson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 16:16:13 PDT 2019


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


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2146
 
+    assert(CI.getNumArgOperands() > 1 && "Need at least 2 args for ssubo");
+    Constant *C;
----------------
nikic wrote:
> This assert is a bit odd, because it checks for more than one arg, while ssubo requires exactly two. I think it can just be dropped entirely, we don't seem to have similar asserts in the surrounding code for other intrinsics.
`foldIntrinsiceWithOverflowCommon` uses `getArgOperand(1)` too, so we'd hit that before the assert.


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

https://reviews.llvm.org/D60061





More information about the llvm-commits mailing list