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 {
37 void getSIProgramInfo(SIProgramInfo &Out, MachineFunction &MF) const;
38 void findNumUsedRegistersSI(MachineFunction &MF,
40 unsigned &NumVGPR) const;
42 /// \brief Emit register usage information so that the GPU driver
43 /// can correctly setup the GPU state.
44 void EmitProgramInfoR600(MachineFunction &MF);
45 void EmitProgramInfoSI(MachineFunction &MF, const SIProgramInfo &KernelInfo);
48 explicit AMDGPUAsmPrinter(TargetMachine &TM, MCStreamer &Streamer);
50 bool runOnMachineFunction(MachineFunction &MF) override;
52 const char *getPassName() const override {
53 return "AMDGPU Assembly Printer";
56 /// Implemented in AMDGPUMCInstLower.cpp
57 void EmitInstruction(const MachineInstr *MI) override;
61 std::vector<std::string> DisasmLines, HexLines;
62 size_t DisasmLineMaxLen;
65 } // End anonymous llvm
67 #endif //AMDGPU_ASMPRINTER_H