[AMDGPU] Do not release VGPRs at -O0
authorJay Foad <jay.foad@amd.com>
Thu, 10 Aug 2023 10:19:41 +0000 (11:19 +0100)
committerTobias Hieta <tobias@hieta.se>
Mon, 14 Aug 2023 08:33:27 +0000 (10:33 +0200)
commit2f49cd1a773da7d2227fa7db952f50137a812300
tree02bb0ceb4b7517e3ec3057840e50129846b42f48
parent8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
[AMDGPU] Do not release VGPRs at -O0

This was an oversight when the GFX11 early release VGPRs optimization
was reimplemented in D153279.

Sending the DEALLOC_VGPRS message is a performance optimization so there
is no need to do it at -O0. In addition it makes some kinds of post
mortem debugging hard or impossible, since VGPR values are no longer
available to inspect at the s_endpgm instruction.

Differential Revision: https://reviews.llvm.org/D157599

(cherry picked from commit 3091bdb86d55e404866823b64d21fd87c247d893)
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
llvm/test/CodeGen/AMDGPU/release-vgprs.mir [new file with mode: 0644]