[PATCH] D59846: AMDGPU: wave_barrier is not isBarrier

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 14:25:06 PDT 2019


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

This is not a control flow instruction, so should not be marked as
isBarrier. This fixes a verifier error if followed by unreachable.


https://reviews.llvm.org/D59846

Files:
  lib/Target/AMDGPU/SIInstructions.td
  test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll


Index: test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll
===================================================================
--- test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll
+++ test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll
@@ -10,6 +10,18 @@
   ret void
 }
 
+; Check for verifier error from interpreting wave_barrier as a control
+; flow barrier.
+
+; GCN-LABEL: {{^}}test_wave_barrier_is_not_isBarrier:
+; GCN-DAG: ; wave barrier
+; GCN-NOT: s_barrier
+define amdgpu_kernel void @test_wave_barrier_is_not_isBarrier() #0 {
+entry:
+  call void @llvm.amdgcn.wave.barrier() #1
+  unreachable
+}
+
 declare void @llvm.amdgcn.wave.barrier() #1
 
 attributes #0 = { nounwind }
Index: lib/Target/AMDGPU/SIInstructions.td
===================================================================
--- lib/Target/AMDGPU/SIInstructions.td
+++ lib/Target/AMDGPU/SIInstructions.td
@@ -197,7 +197,6 @@
   let hasSideEffects = 1;
   let mayLoad = 1;
   let mayStore = 1;
-  let isBarrier = 1;
   let isConvergent = 1;
   let FixedSize = 1;
   let Size = 0;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59846.192357.patch
Type: text/x-patch
Size: 1042 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190326/16032c39/attachment.bin>


More information about the llvm-commits mailing list