[DAGCombiner] Teach DAGCombiner that A-(-B) is A+B.
authorCraig Topper <craig.topper@intel.com>
Thu, 19 Jul 2018 22:24:43 +0000 (22:24 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 19 Jul 2018 22:24:43 +0000 (22:24 +0000)
commitc12c5d421fc92a8f689ce0cabc4962f69774d1be
tree397bd5f5f235ddbe819abdbfb907cd84a1882fb7
parent44edc281d9c3a2845936a0cc27c87ca4b2fb0347
[DAGCombiner] Teach DAGCombiner that A-(-B) is A+B.

We already knew A+(-B) is A-B in visitAdd. This does the opposite for visitSub.

llvm-svn: 337502
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/combine-srem.ll