[all-commits] [llvm/llvm-project] 4c6b18: [TableGen][AMDGPU][RFC] Write register names rathe...

Ivan Kosarev via All-commits all-commits at lists.llvm.org
Tue Sep 22 12:04:46 PDT 2026


  Branch: refs/heads/users/kosarev/registersequence-superregs-simple
  Home:   https://github.com/llvm/llvm-project
  Commit: 4c6b1861b1fdc71a2f00582496a95daa83f6f02a
      https://github.com/llvm/llvm-project/commit/4c6b1861b1fdc71a2f00582496a95daa83f6f02a
  Author: Ivan Kosarev <ivan.kosarev at amd.com>
  Date:   2026-09-22 (Tue, 22 Sep 2026)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetRegisterInfo.h
    M llvm/include/llvm/DebugInfo/DIContext.h
    M llvm/include/llvm/DebugInfo/DWARF/DWARFExpressionPrinter.h
    M llvm/include/llvm/MC/MCRegisterInfo.h
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    M llvm/lib/CodeGen/MIRParser/MIParser.cpp
    M llvm/lib/CodeGen/MachineVerifier.cpp
    M llvm/lib/CodeGen/RDFRegisters.cpp
    M llvm/lib/CodeGen/RegAllocPBQP.cpp
    M llvm/lib/CodeGen/RegisterScavenging.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/lib/CodeGen/TargetRegisterInfo.cpp
    M llvm/lib/DWARFCFIChecker/DWARFCFIAnalysis.cpp
    M llvm/lib/DebugInfo/DWARF/DWARFCFIPrinter.cpp
    M llvm/lib/DebugInfo/DWARF/DWARFExpressionPrinter.cpp
    M llvm/lib/DebugInfo/DWARF/DWARFUnwindTablePrinter.cpp
    M llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
    M llvm/lib/MC/MCInst.cpp
    M llvm/lib/MC/MCRegisterInfo.cpp
    M llvm/lib/MCA/HardwareUnits/RegisterFile.cpp
    M llvm/lib/MCA/InstrBuilder.cpp
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    M llvm/lib/Target/AArch64/AArch64Subtarget.cpp
    M llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCLFIRewriter.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
    M llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
    M llvm/lib/Target/AMDGPU/SIRegisterInfo.h
    M llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
    M llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
    M llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
    M llvm/lib/Target/Hexagon/HexagonBitTracker.cpp
    M llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
    M llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
    M llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
    M llvm/lib/Target/RISCV/RISCVRegisterInfo.h
    M llvm/lib/Target/VE/LVLGen.cpp
    M llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
    M llvm/lib/Target/X86/X86InstrInfo.cpp
    M llvm/lib/Target/X86/X86MCInstLower.cpp
    M llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
    M llvm/tools/llvm-exegesis/lib/BenchmarkResult.cpp
    M llvm/tools/llvm-exegesis/lib/LlvmState.cpp
    M llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp
    M llvm/tools/llvm-exegesis/lib/RegisterAliasing.cpp
    M llvm/tools/llvm-exegesis/lib/X86/Target.cpp
    M llvm/tools/llvm-objdump/SourcePrinter.cpp
    M llvm/unittests/CodeGen/InstrRefLDVTest.cpp
    M llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp
    M llvm/unittests/Target/AMDGPU/RCIUpdateReservedRegsTest.cpp

  Log Message:
  -----------
  [TableGen][AMDGPU][RFC] Write register names rather than return them

MCRegisterInfo::getName() and TargetRegisterInfo::getRegAsmName()
return a std::string, which every caller pays for whether or not it
needs one. Replace them with printName() and printRegAsmName(), which
take the stream to write to.

Most callers print the name and are done, and they now write it where
it goes. Where a name goes in the middle of a message, the statement
that built the message becomes several. The callers that do need the
name as a string keep one in a local variable and write into that;
those that look a name up, among them the MIR parser building its map
of every register, reuse one SmallString across the lookups and
allocate less than they did.

DIDumpOptions::GetNameForDWARFReg takes a stream too and says whether
it wrote a name, which its callers used to ask by testing the returned
StringRef for emptiness. The three that fill it in kept a std::string
alive for the StringRef to point at, and no longer need one.

Co-Authored-By: Claude Opus 5 <noreply at anthropic.com>



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