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 AMDGPU_ASMPRINTER_H
16 #define AMDGPU_ASMPRINTER_H
18 #include "llvm/CodeGen/AsmPrinter.h"
23 class AMDGPUAsmPrinter : public AsmPrinter {
25 struct SIProgramInfo {
37 // Fields set in PGM_RSRC1 pm4 packet.
47 // Bonus information for debugging.
51 void getSIProgramInfo(SIProgramInfo &Out, const MachineFunction &MF) const;
52 void findNumUsedRegistersSI(const MachineFunction &MF,
54 unsigned &NumVGPR) const;
56 /// \brief Emit register usage information so that the GPU driver
57 /// can correctly setup the GPU state.
58 void EmitProgramInfoR600(const MachineFunction &MF);
59 void EmitProgramInfoSI(const MachineFunction &MF, const SIProgramInfo &KernelInfo);
62 explicit AMDGPUAsmPrinter(TargetMachine &TM, MCStreamer &Streamer);
64 bool runOnMachineFunction(MachineFunction &MF) override;
66 const char *getPassName() const override {
67 return "AMDGPU Assembly Printer";
70 /// Implemented in AMDGPUMCInstLower.cpp
71 void EmitInstruction(const MachineInstr *MI) override;
75 std::vector<std::string> DisasmLines, HexLines;
76 size_t DisasmLineMaxLen;
79 } // End anonymous llvm
81 #endif //AMDGPU_ASMPRINTER_H