[all-commits] [llvm/llvm-project] 34e71e: [AMDGPU][SIInsertWaitCnts] Use RegUnits-based trac...

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Tue Dec 2 02:55:48 PST 2025


  Branch: refs/heads/users/pierre-vh/refactor-insertwaitcnt-regunits
  Home:   https://github.com/llvm/llvm-project
  Commit: 34e71e6e6f5604feb8545348ed45562ef6038886
      https://github.com/llvm/llvm-project/commit/34e71e6e6f5604feb8545348ed45562ef6038886
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

  Log Message:
  -----------
  [AMDGPU][SIInsertWaitCnts] Use RegUnits-based tracking

Clean up the tracking logic to rely on register units. The pass was
already "reinventing" the concept just to deal with 16 bit registers.

There are no test changes, functionality is the same, except we can
now track more LDS DMA IDs if we need it. The debug prints also changed
a bit because we now talk in terms of register units.

This also changes the tracking to use a DenseMap instead of a massive
fixed size table. This trades a bit of access speed for a smaller
memory footprint. Allocating and memsetting a huge table to zero
caused a non-negligible performance impact (I've observed up to 50%
of the time in the pass spent in the `memcpy` built-in).

I also think we don't access these often enough to really justify
using a vector. We do a few accesses per instruction, but not much
more. In a huge 120MB LL file, I can barely see the trace of the DenseMap
accesses.

This still isn't as clean as I'd like it to be though. There is a mix
of "VMEMID", "LDS DMA ID", "SGPR RegUnit" and "PhysReg" in the API of WaitCntBrackets.
There is no type safety to avoid mix-ups as these are all integers.
We could add another layer of abstraction on top, but I feel like it's going to add
too much code/boilerplate for such a small issue.


  Commit: a143becc66fe759345fd2f212760691b37d68939
      https://github.com/llvm/llvm-project/commit/a143becc66fe759345fd2f212760691b37d68939
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

  Log Message:
  -----------
  comments


  Commit: 7eceab24efd88a9fc60bc31a40fd2eba530b2ea3
      https://github.com/llvm/llvm-project/commit/7eceab24efd88a9fc60bc31a40fd2eba530b2ea3
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

  Log Message:
  -----------
  Fix build


  Commit: e5d72bfe6eb87efc5205ab52f5744d30b1e2b6f6
      https://github.com/llvm/llvm-project/commit/e5d72bfe6eb87efc5205ab52f5744d30b1e2b6f6
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

  Log Message:
  -----------
  Comments


  Commit: 10726b189f29a29006820c98ee2534602e2fddae
      https://github.com/llvm/llvm-project/commit/10726b189f29a29006820c98ee2534602e2fddae
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

  Log Message:
  -----------
  Remove bloating in map


Compare: https://github.com/llvm/llvm-project/compare/e944acdad530...10726b189f29

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