From: Matt Arsenault Date: Wed, 27 Mar 2019 15:54:45 +0000 (+0000) Subject: AMDGPU: wave_barrier is not isBarrier X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17f72131c2b75309ce6363c8416220bb3d041f2a;p=llvm AMDGPU: wave_barrier is not isBarrier This is not a control flow instruction, so should not be marked as isBarrier. This fixes a verifier error if followed by unreachable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357081 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AMDGPU/SIInstructions.td b/lib/Target/AMDGPU/SIInstructions.td index b0ab7032d97..c3fa1bb41ef 100644 --- a/lib/Target/AMDGPU/SIInstructions.td +++ b/lib/Target/AMDGPU/SIInstructions.td @@ -197,7 +197,6 @@ def WAVE_BARRIER : SPseudoInstSI<(outs), (ins), let hasSideEffects = 1; let mayLoad = 1; let mayStore = 1; - let isBarrier = 1; let isConvergent = 1; let FixedSize = 1; let Size = 0; diff --git a/test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll b/test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll index e305f8eff58..be144b441a1 100644 --- a/test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll +++ b/test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll @@ -10,6 +10,18 @@ entry: 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 }