[all-commits] [llvm/llvm-project] 8a5332: [AMDGPU] Deallocate VGPRs before exiting in dynami...

Diana Picus via All-commits all-commits at lists.llvm.org
Wed Mar 19 01:00:58 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a53324aa5c98787fe2334180a26b426f793d139
      https://github.com/llvm/llvm-project/commit/8a53324aa5c98787fe2334180a26b426f793d139
  Author: Diana Picus <Diana-Magda.Picus at amd.com>
  Date:   2025-03-19 (Wed, 19 Mar 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
    A llvm/test/CodeGen/AMDGPU/release-vgprs-gfx12.mir

  Log Message:
  -----------
  [AMDGPU] Deallocate VGPRs before exiting in dynamic VGPR mode (#130037)

In dynamic VGPR mode, Waves must deallocate all VGPRs before exiting. If
the shader program does not do this, hardware inserts `S_ALLOC_VGPR 0`
before S_ENDPGM, but this may incur some performance cost. Therefore
it's better if the compiler proactively generates that instruction.

This patch extends `si-insert-waitcnts` to deallocate the VGPRs via a
`S_ALLOC_VGPR 0` before any `S_ENDPGM` when in dynamic VGPR mode.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list