]> granicus.if.org Git - llvm/commit
[DAGCombine][X86][AArch64][ARM] (C - x) + y -> (y - x) + C fold
authorRoman Lebedev <lebedev.ri@gmail.com>
Tue, 4 Jun 2019 11:06:08 +0000 (11:06 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Tue, 4 Jun 2019 11:06:08 +0000 (11:06 +0000)
commite270352fc37116d93b83b10e10c60901f2a9c7e1
tree979b19a6923d61e85e445664cd1818521006edbb
parent4d9a476003b62fdb067b5a8440b801ed72730e27
[DAGCombine][X86][AArch64][ARM] (C - x) + y  ->  (y - x) + C  fold

Summary:
All changes except ARM look **great**.
https://rise4fun.com/Alive/R2M

The regression `test/CodeGen/ARM/addsubcarry-promotion.ll`
is recovered fully by D62392 + D62450.

Reviewers: RKSimon, craig.topper, spatel, rogfer01, efriedma

Reviewed By: efriedma

Subscribers: dmgreen, javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362487 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/shift-amount-mod.ll
test/CodeGen/AArch64/sink-addsub-of-const.ll
test/CodeGen/ARM/addsubcarry-promotion.ll
test/CodeGen/X86/shift-amount-mod.ll
test/CodeGen/X86/sink-addsub-of-const.ll