[PATCH] D63065: [InstSimplify] Fix addo/subo undef folds (PR42209)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 9 14:05:27 PDT 2019


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

Fix folds of addo and subo with an undef operand to be:

- `subo(X, undef)` folds to `{ 0, false }` (holds for `undef = X`).
- `addo(X, undef)` folds to `{ -1, false }` (holds for `undef = ~X`).
- Same for commuted variants.

These are consistent with the folds we use for subsat and addsat.


Repository:
  rL LLVM

https://reviews.llvm.org/D63065

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Transforms/InstCombine/with_overflow.ll
  llvm/test/Transforms/InstSimplify/call.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63065.203755.patch
Type: text/x-patch
Size: 4389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190609/43f2f564/attachment.bin>


More information about the llvm-commits mailing list