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