[llvm] r265992 - Revert "AMDGPU/SI: Do not generate s_waitcnt after ds_permute/ds_bpermute"

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 13:38:42 PDT 2016


Author: tstellar
Date: Mon Apr 11 15:38:40 2016
New Revision: 265992

URL: http://llvm.org/viewvc/llvm-project?rev=265992&view=rev
Log:
Revert "AMDGPU/SI: Do not generate s_waitcnt after ds_permute/ds_bpermute"

This reverts commit r263720.

Just confirmed that s_waitcnt is required after ds_permute/ds_bpermute.

Modified:
    llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td
    llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll
    llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.ds.permute.ll

Modified: llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td?rev=265992&r1=265991&r2=265992&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td Mon Apr 11 15:38:40 2016
@@ -2580,7 +2580,7 @@ multiclass DS_1A1D_PERMUTE <bits<8> op,
   dag ins = (ins VGPR_32:$addr, rc:$data0),
   string asm = opName#" $vdst, $addr, $data0"> {
 
-  let LGKM_CNT = 0, mayLoad = 0, mayStore = 0, isConvergent = 1 in {
+  let mayLoad = 0, mayStore = 0, isConvergent = 1 in {
     def "" : DS_Pseudo <opName, outs, ins,
      [(set (i32 rc:$vdst),
          (node (i32 VGPR_32:$addr), (i32 rc:$data0)))]>;

Modified: llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll?rev=265992&r1=265991&r2=265992&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.ds.bpermute.ll Mon Apr 11 15:38:40 2016
@@ -4,34 +4,11 @@ declare i32 @llvm.amdgcn.ds.bpermute(i32
 
 ; FUNC-LABEL: {{^}}ds_bpermute:
 ; CHECK: ds_bpermute_b32 v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}
+; CHECK: s_waitcnt lgkmcnt
 define void @ds_bpermute(i32 addrspace(1)* %out, i32 %index, i32 %src) nounwind {
   %bpermute = call i32 @llvm.amdgcn.ds.bpermute(i32 %index, i32 %src) #0
   store i32 %bpermute, i32 addrspace(1)* %out, align 4
   ret void
 }
 
-; FUNC-LABEL: {{^}}bpermute_no_waitcnt_test:
-; CHECK: s_cbranch_scc1
-; CHECK: ds_bpermute_b32 v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}
-; CHECK-NOT: s_waitcnt
-define void @bpermute_no_waitcnt_test(i32 addrspace(1)* %out, i32 %cond) {
-entry:
-
-  %tmp = icmp eq i32 %cond, 0
-  br i1 %tmp, label %if, label %else
-
-if:                                               ; preds = %entry
-
-  %bpermute = call i32 @llvm.amdgcn.ds.bpermute(i32 0, i32 0) #0
-  br label %endif
-
-else:                                             ; preds = %entry
-  br label %endif
-
-endif:
-  %val = phi i32 [ %bpermute, %if ], [0, %else]      ; preds = %else, %if
-  store i32 %val, i32 addrspace(1)* %out, align 4
-  ret void
-}
-
 attributes #0 = { nounwind readnone convergent }

Modified: llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.ds.permute.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.ds.permute.ll?rev=265992&r1=265991&r2=265992&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.ds.permute.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/llvm.amdgcn.ds.permute.ll Mon Apr 11 15:38:40 2016
@@ -4,34 +4,11 @@ declare i32 @llvm.amdgcn.ds.permute(i32,
 
 ; FUNC-LABEL: {{^}}ds_permute:
 ; CHECK: ds_permute_b32 v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}
+; CHECK: s_waitcnt lgkmcnt
 define void @ds_permute(i32 addrspace(1)* %out, i32 %index, i32 %src) nounwind {
-  %permute = call i32 @llvm.amdgcn.ds.permute(i32 %index, i32 %src) #0
-  store i32 %permute, i32 addrspace(1)* %out, align 4
+  %bpermute = call i32 @llvm.amdgcn.ds.permute(i32 %index, i32 %src) #0
+  store i32 %bpermute, i32 addrspace(1)* %out, align 4
   ret void
 }
 
-; FUNC-LABEL: {{^}}permute_no_waitcnt_test:
-; CHECK: s_cbranch_scc1
-; CHECK: ds_permute_b32 v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}
-; CHECK-NOT: s_waitcnt
-define void @permute_no_waitcnt_test(i32 addrspace(1)* %out, i32 %cond) {
-entry:
-
-  %tmp = icmp eq i32 %cond, 0
-  br i1 %tmp, label %if, label %else
-
-if:                                               ; preds = %entry
-  %permute = call i32 @llvm.amdgcn.ds.permute(i32 0, i32 0) #0
-  br label %endif
-
-else:                                             ; preds = %entry
-  br label %endif
-
-endif:
-  %val = phi i32 [ %permute, %if ], [0, %else]      ; preds = %else, %if
-  store i32 %val, i32 addrspace(1)* %out, align 4
-  ret void
-}
-
-
 attributes #0 = { nounwind readnone convergent }




More information about the llvm-commits mailing list