OSDN Git Service

[DAGCombine] Add ADD(SUB,SUB) combines
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 4 Feb 2019 13:44:49 +0000 (13:44 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 4 Feb 2019 13:44:49 +0000 (13:44 +0000)
commitcd297b5b93d53c2fd7d482537f8b024bfe1bb291
tree82eb07646d4b578ef272ca1c211ea52eafd5f917
parentab6a7293259b9eb5579f749ad6bbe4f89de9a517
[DAGCombine] Add ADD(SUB,SUB) combines

Noticed while investigating PR40483, and fixes the basic test case from the bug - but not a more general case.

We're pretty weak at dealing with ADD/SUB combines compared to the SimplifyAssociativeOrCommutative/SimplifyUsingDistributiveLaws abilities that InstCombine can manage.

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