[AMDGPU] Revise handling of preexisting waitcnt
authorAustin Kerbow <Austin.Kerbow@amd.com>
Fri, 9 Apr 2021 17:54:21 +0000 (10:54 -0700)
committerAustin Kerbow <Austin.Kerbow@amd.com>
Thu, 6 May 2021 00:21:33 +0000 (17:21 -0700)
commitf5199d7ae0edf47c41d7347aad18f893ad20f0b3
treec04218aff725de9444c54697cbeb97b99f953651
parent9ba5238c28daf930df3dcb9bc90b5c8531ae1466
[AMDGPU] Revise handling of preexisting waitcnt

Preexisting waitcnt may not update the scoreboard if the instruction
being examined needed to wait on fewer counters than what was encoded in
the old waitcnt instruction. Fixing this results in the elimination of
some redudnat waitcnt.

These changes also enable combining consecutive waitcnt into a single
S_WAITCNT or S_WAITCNT_VSCNT instruction.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D100281
14 files changed:
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
llvm/test/CodeGen/AMDGPU/GlobalISel/flat-scratch.ll
llvm/test/CodeGen/AMDGPU/atomicrmw-nand.ll
llvm/test/CodeGen/AMDGPU/flat-scratch.ll
llvm/test/CodeGen/AMDGPU/fp64-atomics-gfx90a.ll
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.gws.barrier.ll
llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-agent.ll
llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-system.ll
llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-volatile.ll
llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-workgroup.ll
llvm/test/CodeGen/AMDGPU/waitcnt-debug.mir
llvm/test/CodeGen/AMDGPU/waitcnt-preexisting-vscnt.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/waitcnt-preexisting.mir