]> granicus.if.org Git - llvm/commit
[DAGCombine][X86][AArch64][AMDGPU] (x - y) + -1 -> add (xor y, -1), x fold
authorRoman Lebedev <lebedev.ri@gmail.com>
Tue, 28 May 2019 17:54:13 +0000 (17:54 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Tue, 28 May 2019 17:54:13 +0000 (17:54 +0000)
commit6f9cfda93b472d0f8f7aa6a41b0da87088bff73d
tree046bdad9ce4bef0c7066c1a3cef6d710a428d8bf
parent5188cc4e065ddec376e94a1f0ecd261d0d061c64
[DAGCombine][X86][AArch64][AMDGPU] (x - y) + -1  ->  add (xor y, -1), x  fold

Summary:
This prevents regressions in next patch,
and somewhat recovers from the regression to AMDGPU test in D62223.

It is indeed not great that we leave vector decrement,
don't transform it into vector add all-ones..

https://rise4fun.com/Alive/ZRl

Reviewers: RKSimon, craig.topper, spatel, arsenm

Reviewed By: RKSimon, arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, javed.absar, dstuttard, tpr, t-tye, kristof.beyls, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361855 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/xor.ll
test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.ll
test/CodeGen/X86/xor.ll