[llvm] [AMDGPU] Improve debug printing of regunits in SIInsertWaitcnts (PR #210066)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 07:10:38 PDT 2026


https://github.com/jayfoad created https://github.com/llvm/llvm-project/pull/210066

Use the standard printRegUnit helper.


>From be407a07819ca388708c43e52603d5f7aefa7718 Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Thu, 16 Jul 2026 14:45:14 +0100
Subject: [PATCH] [AMDGPU] Improve debug printing of regunits in
 SIInsertWaitcnts

Use the standard printRegUnit helper.
---
 llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
index 5996cdf42a956..e9ad515968ae3 100644
--- a/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
@@ -1143,7 +1143,8 @@ void WaitcntBrackets::print(raw_ostream &OS) const {
           continue;
         unsigned RelScore = RegScore - LB - 1;
         if (ID < REGUNITS_END) {
-          OS << ' ' << RelScore << ":vRU" << ID;
+          OS << ' ' << RelScore << ':'
+             << printRegUnit(static_cast<MCRegUnit>(ID), &Context->TRI);
         } else {
           assert(ID >= LDSDMA_BEGIN && ID < LDSDMA_END &&
                  "Unhandled/unexpected ID value!");
@@ -1160,7 +1161,8 @@ void WaitcntBrackets::print(raw_ostream &OS) const {
           if (RegScore <= LB)
             continue;
           unsigned RelScore = RegScore - LB - 1;
-          OS << ' ' << RelScore << ":sRU" << static_cast<unsigned>(ID);
+          OS << ' ' << RelScore << ':'
+             << printRegUnit(static_cast<MCRegUnit>(ID), &Context->TRI);
         }
       }
 



More information about the llvm-commits mailing list