OSDN Git Service

[DAGCombine][X86][AArch64][AMDGPU] (x - y) + -1 -> add (xor y, -1), x fold. Try 3
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 30 May 2019 20:37:29 +0000 (20:37 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 30 May 2019 20:37:29 +0000 (20:37 +0000)
commit97a393580c4ad72d1d505f24866c66ced7cf6634
tree0e95c6b0c9dfadc26a198fc3ad53f7bd476b48c6
parent58c76e2b4efdebc1a5b767c64f6f7e568c17a42b
[DAGCombine][X86][AArch64][AMDGPU] (x - y) + -1  ->  add (xor y, -1), x  fold. Try 3

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

This is a recommit, originally committed in rL361852, but reverted
to investigate test-suite compile-time hangs, and then reverted in
rL362109 to fix missing constant folds that were causing
endless combine loops.

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@362144 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