[PATCH] D45886: AMDGPU: Fix SDWA peephole for V_AND_B32

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 20 08:56:27 PDT 2018


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

Found by inspection. We care about the operand that *doesn't*
contain the immediate.

I believe this is currently not hit because we fold 0xff / 0xffff
immediates only later.

Change-Id: Ic3cf8538bc7da5eff3200d96eccf9d339e6345a7


Repository:
  rL LLVM

https://reviews.llvm.org/D45886

Files:
  lib/Target/AMDGPU/SIPeepholeSDWA.cpp


Index: lib/Target/AMDGPU/SIPeepholeSDWA.cpp
===================================================================
--- lib/Target/AMDGPU/SIPeepholeSDWA.cpp
+++ lib/Target/AMDGPU/SIPeepholeSDWA.cpp
@@ -699,7 +699,7 @@
 
     MachineOperand *Dst = TII->getNamedOperand(MI, AMDGPU::OpName::vdst);
 
-    if (TRI->isPhysicalRegister(Src1->getReg()) ||
+    if (TRI->isPhysicalRegister(ValSrc->getReg()) ||
         TRI->isPhysicalRegister(Dst->getReg()))
       break;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45886.143324.patch
Type: text/x-patch
Size: 464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180420/b4efeb70/attachment.bin>


More information about the llvm-commits mailing list