[PATCH] D73288: [InstCombine] Move negation handling into freelyNegateValue()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 12:38:49 PST 2020


nikic created this revision.
nikic added reviewers: spatel, lebedev.ri, xbolva00.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

Followup to D72978 <https://reviews.llvm.org/D72978>. This moves existing negation handling in InstCombine into freelyNegateValue(), which make it more composable. In particular, the negations of div/zext/sext can now be applied across a `shl`, rather than just for direct negations.

The next step is to add multiply support to fix https://bugs.llvm.org/show_bug.cgi?id=44234.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73288

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/sub.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73288.239973.patch
Type: text/x-patch
Size: 11027 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200123/9c37c9a8/attachment.bin>


More information about the llvm-commits mailing list