[AMDGPU] Omit unnecessary waitcnt before barriers
authorAustin Kerbow <Austin.Kerbow@amd.com>
Fri, 25 Feb 2022 07:26:51 +0000 (23:26 -0800)
committerAustin Kerbow <Austin.Kerbow@amd.com>
Mon, 7 Mar 2022 16:23:53 +0000 (08:23 -0800)
commit8d0c34fd4fb66ea0d19563154a59658e4b7f35d4
tree80e02c329b3d2b0f5b9d21ac25b2447496aaca4d
parent20c4664552e2e5c1d85db13d3568b7d4a3e843ef
[AMDGPU] Omit unnecessary waitcnt before barriers

It is not necessary to wait for all outstanding memory operations before
barriers on hardware that can back off of the barrier in the event of an
exception when traps are enabled. Add a new subtarget feature which
tracks which HW has this ability.

Reviewed By: #amdgpu, rampitec

Differential Revision: https://reviews.llvm.org/D120544
llvm/lib/Target/AMDGPU/AMDGPU.td
llvm/lib/Target/AMDGPU/GCNSubtarget.h
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
llvm/test/CodeGen/AMDGPU/back-off-barrier-subtarget-feature.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/waitcnt-preexisting-vscnt.mir
llvm/test/CodeGen/AMDGPU/waitcnt-vscnt.ll