[PATCH] D35192: [ARM] Use ADDCARRY / SUBCARRY

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 09:33:50 PDT 2017


rogfer01 updated this revision to Diff 107118.
rogfer01 edited the summary of this revision.
rogfer01 added a comment.

ChangeLog:

- Correctly handle the second operand of `ISD::SUBCARRY`. We need to invert its value (i.e. `1-x`) before passing it to `ARMISD::SUBE`, also the result of `ARMISD::SUBE` has to be inverted again to match what `ISD::SUBCARRY` means.
- Fix `USUBO` lowering as a consequence of the above.
- Add a combiner for `(SUBC 1, (SUBC 1, X)) → X `
- Compute the known bits of `(SUBC 1, (ADDE 0, 0, C))` (1 bit) to avoid spurious `and` instructions.
- Update the tests for `usub_builtin_overflow` with the correct code generation.
- Remove combiners that became pointless after the changes above.


https://reviews.llvm.org/D35192

Files:
  lib/Target/ARM/ARMISelLowering.cpp
  lib/Target/ARM/ARMISelLowering.h
  test/CodeGen/ARM/intrinsics-overflow.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35192.107118.patch
Type: text/x-patch
Size: 15249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170718/e7bc353b/attachment.bin>


More information about the llvm-commits mailing list