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"
24 class AMDGPUAsmPrinter : public AsmPrinter {
26 struct SIProgramInfo {
38 // Fields set in PGM_RSRC1 pm4 packet.
48 // Bonus information for debugging.
52 void getSIProgramInfo(SIProgramInfo &Out, MachineFunction &MF) const;
53 void findNumUsedRegistersSI(MachineFunction &MF,
55 unsigned &NumVGPR) const;
57 /// \brief Emit register usage information so that the GPU driver
58 /// can correctly setup the GPU state.
59 void EmitProgramInfoR600(MachineFunction &MF);
60 void EmitProgramInfoSI(MachineFunction &MF, const SIProgramInfo &KernelInfo);
63 explicit AMDGPUAsmPrinter(TargetMachine &TM, MCStreamer &Streamer);
65 bool runOnMachineFunction(MachineFunction &MF) override;
67 const char *getPassName() const override {
68 return "AMDGPU Assembly Printer";
71 /// Implemented in AMDGPUMCInstLower.cpp
72 void EmitInstruction(const MachineInstr *MI) override;
76 std::vector<std::string> DisasmLines, HexLines;
77 size_t DisasmLineMaxLen;
80 } // End anonymous llvm
82 #endif //AMDGPU_ASMPRINTER_H