Skip to content

Commit

Permalink
[AMDGPU][AsmParser] Print names of parsed registers in debug output.
Browse files Browse the repository at this point in the history
Knowing just their numeric values is not very helpful.

Part of <llvm#62629>.
  • Loading branch information
kosarev committed Aug 7, 2024
1 parent 8a5f33f commit 30942c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//

#include "AMDKernelCodeT.h"
#include "MCTargetDesc/AMDGPUInstPrinter.h"
#include "MCTargetDesc/AMDGPUMCExpr.h"
#include "MCTargetDesc/AMDGPUMCKernelDescriptor.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 30942c5

Please sign in to comment.