1 //===-- AMDGPUAsmPrinter.h - Print AMDGPU assembly code ---------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief AMDGPU Assembly printer class.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_R600_AMDGPUASMPRINTER_H
16 #define LLVM_LIB_TARGET_R600_AMDGPUASMPRINTER_H
18 #include "llvm/CodeGen/AsmPrinter.h"
23 class AMDGPUAsmPrinter : public AsmPrinter {
25 struct SIProgramInfo {
40 // Fields set in PGM_RSRC1 pm4 packet.
53 // Bonus information for debugging.
58 void getSIProgramInfo(SIProgramInfo &Out, const MachineFunction &MF) const;
59 void findNumUsedRegistersSI(const MachineFunction &MF,
61 unsigned &NumVGPR) const;
63 /// \brief Emit register usage information so that the GPU driver
64 /// can correctly setup the GPU state.
65 void EmitProgramInfoR600(const MachineFunction &MF);
66 void EmitProgramInfoSI(const MachineFunction &MF, const SIProgramInfo &KernelInfo);
69 explicit AMDGPUAsmPrinter(TargetMachine &TM, MCStreamer &Streamer);
71 bool runOnMachineFunction(MachineFunction &MF) override;
73 const char *getPassName() const override {
74 return "AMDGPU Assembly Printer";
77 /// Implemented in AMDGPUMCInstLower.cpp
78 void EmitInstruction(const MachineInstr *MI) override;
80 void EmitEndOfAsmFile(Module &M) override;
84 std::vector<std::string> DisasmLines, HexLines;
85 size_t DisasmLineMaxLen;
88 } // End anonymous llvm