[PATCH] D55071: [AMDGPU] Split 64-Bit XNOR to 64-Bit NOT/XOR

Graham Sellers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 29 12:13:00 PST 2018


grahamsellers created this revision.
grahamsellers added reviewers: arsenm, nhaehnle.
Herald added subscribers: llvm-commits, t-tye, tpr, dstuttard, yaxunl, wdng, jvesely, kzhuravl.

The identity ~(x ^ y) == (~x ^ y) == (x ^ ~y) allows XNOR (XOR/NOT) to turn into NOT/XOR. Handling this case with its own split means we can make the NOT remain in the scalar unit. Previously, we split 64-bit XNOR into two 32-bit XNOR, then lowered. Now, we get three instructions (s_not, v_xor, v_xor) rather than four in the case where either of the sources is a scalar 64-bit.

Add test cases to xnor.ll to attempt XNOR Vx, Sy and XNOR Sx, Vy. Also adding test that uses the opposite identity such that (~x ^ y) on the scalar unit (or vector for gfx906) can generate XNOR. This already worked, but I didn't see a test for it.


Repository:
  rL LLVM

https://reviews.llvm.org/D55071

Files:
  lib/Target/AMDGPU/SIInstrInfo.cpp
  lib/Target/AMDGPU/SIInstrInfo.h
  test/CodeGen/AMDGPU/xnor.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55071.175923.patch
Type: text/x-patch
Size: 5259 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181129/f7a70412/attachment.bin>


More information about the llvm-commits mailing list