[llvm] [AMDGPU] Add GFX12 wave register names with WAVE_ prefix (PR #144352)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 14 06:22:47 PDT 2025
================
@@ -167,7 +167,14 @@ namespace Hwreg {
// NOLINTBEGIN
// clang-format off
static constexpr CustomOperand Operands[] = {
- {{""}},
+ // GFX12+ renamed registers
+ {{"HW_REG_WAVE_MODE"}, ID_MODE, isGFX12Plus},
+ {{"HW_REG_WAVE_STATUS"}, ID_STATUS, isGFX12Plus},
+ {{"HW_REG_WAVE_GPR_ALLOC"}, ID_GPR_ALLOC, isGFX12Plus},
+ {{"HW_REG_WAVE_LDS_ALLOC"}, ID_LDS_ALLOC, isGFX12Plus},
+ {{"HW_REG_WAVE_HW_ID1"}, ID_HW_ID1, isGFX12Plus},
+ {{"HW_REG_WAVE_HW_ID2"}, ID_HW_ID2, isGFX12Plus},
+
{{"HW_REG_MODE"}, ID_MODE},
----------------
jayfoad wrote:
The original design of this table was that you look up ID values directly. That is why entry 0 is "", because we want "HW_REG_MODE" to be entry 1, because ID_MODE == 1.
Then we started getting cases where the same ID value meant different registers on different subtargets, but we still tried to keep _most_ entries in the correct position. That is why getNameFromOperandTable first tries direct lookup (fast case) and then falls back to a table search (slow case).
Now I am wondering if we should abandon the idea of direct lookup. Instead we could keep this table ordered by ID, and always do a binary search.
https://github.com/llvm/llvm-project/pull/144352
More information about the llvm-commits
mailing list