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..
| Paths 
 |  Differential  D62263  
[DAGCombine][X86][AArch64][AMDGPU] (x - y) + -1  ->  add (xor y, -1), x  fold ClosedPublic Authored by lebedev.ri on May 22 2019, 10:30 AM. 
Details 
 Summary This prevents regressions in next patch, It is indeed not great that we leave vector decrement, 
Diff Detail 
 Event TimelineHerald added subscribers: kristof.beyls, t-tye, tpr and 7 others.  ·  View Herald TranscriptMay 22 2019, 10:30 AM lebedev.ri added inline comments. lebedev.ri added a parent revision: D62257: [DAGCombiner][X86][AArch64] (x - C) + y  ->  (x + y) - C  fold.May 22 2019, 10:33 AM lebedev.ri mentioned this in D62223: [DAGCombiner][X86][AArch64][AMDGPU] (x + C) - y  ->  (x - y) + C  fold.May 22 2019, 10:36 AM lebedev.ri marked an inline comment as done. lebedev.ri added inline comments. 
 lebedev.ri added a child revision: D62266: [DAGCombine][X86][AArch64][ARM] (C - x) + y  ->  (y - x) + C  fold.May 22 2019, 12:11 PM 
 lebedev.ri marked an inline comment as done. lebedev.ri added inline comments. 
 lebedev.ri marked 2 inline comments as done.Comment Actions Fix the fold (: 
 This revision is now accepted and ready to land.May 23 2019, 10:53 AM Comment Actions LGTM. This should never be worse for AMDGPU 
 lebedev.ri added a child revision: D62294: [DAGCombine] (x - C) - y  ->  (x - y) - C  fold.May 28 2019, 10:21 AM lebedev.ri removed a child revision: D62266: [DAGCombine][X86][AArch64][ARM] (C - x) + y  ->  (y - x) + C  fold. Closed by commit rL361855: [DAGCombine][X86][AArch64][AMDGPU] (x - y) + -1  ->  add (xor y, -1), x  fold (authored by lebedevri).  ·  Explain WhyMay 28 2019, 10:51 AM This revision was automatically updated to reflect the committed changes. This revision is now accepted and ready to land.May 28 2019, 12:04 PM Closed by commit rL361873: [DAGCombine][X86][AArch64][AMDGPU] (x - y) + -1  ->  add (xor y, -1), x  fold. (authored by lebedevri).  ·  Explain WhyMay 28 2019, 1:39 PM This revision was automatically updated to reflect the committed changes. This revision is now accepted and ready to land.May 30 2019, 9:05 AM lebedev.ri removed a parent revision: D62257: [DAGCombiner][X86][AArch64] (x - C) + y  ->  (x + y) - C  fold.May 30 2019, 1:21 PM Closed by commit rL362144: [DAGCombine][X86][AArch64][AMDGPU] (x - y) + -1  ->  add (xor y, -1), x  fold. (authored by lebedevri).  ·  Explain WhyMay 30 2019, 1:35 PM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
 
Diff 202288 llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
 
 llvm/trunk/test/CodeGen/AArch64/xor.ll
 llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.ll
 llvm/trunk/test/CodeGen/X86/xor.ll
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||