[DAGCombiner] fold (addcarry (xor a, -1), b, c) -> (subcarry b, a, !c) and flip carry.
authorAmaury Sechet <deadalnix@gmail.com>
Tue, 16 Jul 2019 15:17:00 +0000 (15:17 +0000)
committerAmaury Sechet <deadalnix@gmail.com>
Tue, 16 Jul 2019 15:17:00 +0000 (15:17 +0000)
commitf34a69c2e2792f9702f14cc64723ff89294ba911
treee5a155fb09b38ae5d55ecc7fe95a45d2b454d0b9
parentd3941e663066eb120ea8b79983122897d503d1c2
[DAGCombiner] fold (addcarry (xor a, -1), b, c) -> (subcarry b, a, !c) and flip carry.

Summary:
As per title. DAGCombiner only mathes the special case where b = 0, this patches extends the pattern to match any value of b.

Depends on D57302

Reviewers: hfinkel, RKSimon, craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 366214
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/addcarry.ll
llvm/test/CodeGen/X86/subcarry.ll