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

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Wed Dec 3 01:32:55 PST 2025


  Branch: refs/heads/users/pierre-vh/refactor-insertwaitcnt-regunits
  Home:   https://github.com/llvm/llvm-project
  Commit: 0446851aac08fc24724884982cd759cf1ea8389f
      https://github.com/llvm/llvm-project/commit/0446851aac08fc24724884982cd759cf1ea8389f
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-12-03 (Wed, 03 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: 467f4ae0c47abdda8f96574403dbf693e935ca3f
      https://github.com/llvm/llvm-project/commit/467f4ae0c47abdda8f96574403dbf693e935ca3f
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-12-03 (Wed, 03 Dec 2025)

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

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


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

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

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


  Commit: 1bd42c2c21105773ec47c6cd0e1ef8df89e88aff
      https://github.com/llvm/llvm-project/commit/1bd42c2c21105773ec47c6cd0e1ef8df89e88aff
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-12-03 (Wed, 03 Dec 2025)

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

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


  Commit: 96be4e9e74e9f0129b10d09627615fbac7ed931f
      https://github.com/llvm/llvm-project/commit/96be4e9e74e9f0129b10d09627615fbac7ed931f
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-12-03 (Wed, 03 Dec 2025)

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

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


  Commit: 1a77571c28e7993c62965d088f729fc585912791
      https://github.com/llvm/llvm-project/commit/1a77571c28e7993c62965d088f729fc585912791
  Author: pvanhout <pierre.vanhoutryve at amd.com>
  Date:   2025-12-03 (Wed, 03 Dec 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
    M llvm/test/CodeGen/AMDGPU/lds-dma-waits.ll

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


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

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