From e9ad7e9a714d148ae670c2b29b2dfc87ba651263 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Wed, 27 Mar 2019 15:54:45 +0000 Subject: [PATCH] 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. llvm-svn: 357081 --- llvm/lib/Target/AMDGPU/SIInstructions.td | 1 - llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AMDGPU/SIInstructions.td b/llvm/lib/Target/AMDGPU/SIInstructions.td index b0ab703..c3fa1bb 100644 --- a/llvm/lib/Target/AMDGPU/SIInstructions.td +++ b/llvm/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/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll b/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll index e305f8e..be144b4 100644 --- a/llvm/test/CodeGen/AMDGPU/llvm.amdgcn.wave.barrier.ll +++ b/llvm/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 } -- 2.7.4