OSDN Git Service

[InstSimplify] Fix addo/subo undef folds (PR42209)
authorRoman Lebedev <lebedev.ri@gmail.com>
Sun, 16 Jun 2019 20:39:45 +0000 (20:39 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sun, 16 Jun 2019 20:39:45 +0000 (20:39 +0000)
commitd09f140cd1ebdfcabc333c45fe7e7fe59752bdf9
treec47e24a30660edbb91db463a41be2321a3fbf65a
parente51018c2299b60912b7b4d1aaf6e83f1e905edb5
[InstSimplify] Fix addo/subo undef folds (PR42209)

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

`@llvm.{u,s}{add,sub}.with.overflow` all fold to `{ undef, false }`,
 as per LLVM undef rules.
Same for commuted variants.

Based on the original version of the patch by @nikic.

Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=42209 | PR42209 ]]

Differential Revision: https://reviews.llvm.org/D63065

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363522 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstCombine/with_overflow.ll
test/Transforms/InstSimplify/call.ll