[llvm] 15dacb4 - [AMDGPU][AsmParser] Print names of parsed registers in debug output. (#102328)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 8 05:46:10 PDT 2024
Author: Ivan Kosarev
Date: 2024-08-08T13:46:06+01:00
New Revision: 15dacb452f3ae210837f5fc0839489d9801c8fc3
URL: https://github.com/llvm/llvm-project/commit/15dacb452f3ae210837f5fc0839489d9801c8fc3
DIFF: https://github.com/llvm/llvm-project/commit/15dacb452f3ae210837f5fc0839489d9801c8fc3.diff
LOG: [AMDGPU][AsmParser] Print names of parsed registers in debug output. (#102328)
Knowing just their numeric values is not very helpful.
Part of <https://github.com/llvm/llvm-project/issues/62629>.
Added:
Modified:
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
index c8b594ffbc645..bbd9d75aac0e9 100644
--- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "AMDKernelCodeT.h"
+#include "MCTargetDesc/AMDGPUInstPrinter.h"
#include "MCTargetDesc/AMDGPUMCExpr.h"
#include "MCTargetDesc/AMDGPUMCKernelDescriptor.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
@@ -1133,7 +1134,8 @@ class AMDGPUOperand : public MCParsedAsmOperand {
void print(raw_ostream &OS) const override {
switch (Kind) {
case Register:
- OS << "<register " << getReg() << " mods: " << Reg.Mods << '>';
+ OS << "<register " << AMDGPUInstPrinter::getRegisterName(getReg())
+ << " mods: " << Reg.Mods << '>';
break;
case Immediate:
OS << '<' << getImm();
More information about the llvm-commits
mailing list