aco: don't create sendmsg(dealloc_vgprs) if scratch is used
LLVM does something similar: https://reviews.llvm.org/D153295
fossil-db (gfx1100):
Totals from 21 (0.02% of 133461) affected shaders:
Instrs: 147428 -> 147396 (-0.02%)
CodeSize: 797188 -> 797060 (-0.02%)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 2930317cea ("aco/gfx11: deallocate VGPRs at the end of the shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24669>
This commit is contained in:
@@ -1345,6 +1345,11 @@ dealloc_vgprs(Program* program)
|
||||
if (program->max_reg_demand.vgpr <= get_addr_vgpr_from_waves(program, max_waves))
|
||||
return false;
|
||||
|
||||
/* sendmsg(dealloc_vgprs) releases scratch, so this isn't safe if there is a in-progress scratch
|
||||
* store. */
|
||||
if (uses_scratch(program))
|
||||
return false;
|
||||
|
||||
Block& block = program->blocks.back();
|
||||
|
||||
/* don't bother checking if there is a pending VMEM store or export: there almost always is */
|
||||
|
||||
Reference in New Issue
Block a user