]> granicus.if.org Git - llvm/commit
[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)
commitbd1ee1116fd928785f09a4e662bc80f1b6e16cff
treebf090374ed38412d4501c27fdb76a4791af72780
parentaeefee98c17f2b70481a7a365a3dc912bbf0ae93
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366214 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/addcarry.ll
test/CodeGen/X86/subcarry.ll