[X86] Prevent the creation of redundant ops for sadd and ssub with overflow.
authorJuergen Ributzka <juergen@apple.com>
Fri, 24 Jan 2014 06:47:57 +0000 (06:47 +0000)
committerJuergen Ributzka <juergen@apple.com>
Fri, 24 Jan 2014 06:47:57 +0000 (06:47 +0000)
commitfe08a38a2c9e562bc18e2e93794b84fc1b31da3d
treeafcbd4ca1625d9d965e34ee6c8c95881fe4c4fd2
parentc30791627e94490515f7141ab8b9b12621268871
[X86] Prevent the creation of redundant ops for sadd and ssub with overflow.

This commit teaches the X86 backend to create the same X86 instructions when it
lowers an sadd/ssub with overflow intrinsic and a conditional branch that uses
that overflow result. This allows SelectionDAG to recognize and remove one of
the redundant operations.

This fixes <rdar://problem/15874016> and <rdar://problem/15661073>.

Reviewed by Nadav

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199976 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/saddo-redundant-add.ll [new file with mode: 0644]