]> granicus.if.org Git - llvm/commit
[DAGCombiner][X86][AArch64] (x - C) + y -> (x + y) - C fold
authorRoman Lebedev <lebedev.ri@gmail.com>
Tue, 28 May 2019 17:54:04 +0000 (17:54 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Tue, 28 May 2019 17:54:04 +0000 (17:54 +0000)
commit5188cc4e065ddec376e94a1f0ecd261d0d061c64
tree682b12cac5157bb71219abeaa063fe3824e67202
parent7728af49e56c39eb08dfda0256d933f4e481cfe5
[DAGCombiner][X86][AArch64] (x - C) + y  ->  (x + y) - C  fold

Summary:
Only vector tests are being affected here,
since subtraction by scalar constant is rewritten
as addition by negated constant.

No surprising test changes.

https://rise4fun.com/Alive/pbT

Reviewers: RKSimon, craig.topper, spatel

Reviewed By: RKSimon

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361854 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/sink-addsub-of-const.ll
test/CodeGen/X86/sink-addsub-of-const.ll
test/CodeGen/X86/vector-idiv-sdiv-128.ll
test/CodeGen/X86/vector-idiv-sdiv-256.ll
test/CodeGen/X86/vector-idiv-sdiv-512.ll