LLVM: lib/Target/AMDGPU/R600AsmPrinter.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

27

28using namespace llvm;

29

32 std::unique_ptr &&Streamer) {

34}

35

37 std::unique_ptr Streamer)

39

41 return "R600 Assembly Printer";

42}

43

44void R600AsmPrinter::EmitProgramInfoR600(const MachineFunction &MF) {

45 unsigned MaxGPR = 0;

46 bool killPixel = false;

50

53 if (MI.getOpcode() == R600::KILLGT)

54 killPixel = true;

55 unsigned numOperands = MI.getNumOperands();

56 for (unsigned op_idx = 0; op_idx < numOperands; op_idx++) {

59 continue;

60 unsigned HWReg = RI->getHWRegIndex(MO.getReg());

61

62

63 if (HWReg > 127)

64 continue;

65 MaxGPR = std::max(MaxGPR, HWReg);

66 }

67 }

68 }

69

70 unsigned RsrcReg;

72

73 switch (MF.getFunction().getCallingConv()) {

74 default: [[fallthrough]];

79 }

80 } else {

81

82 switch (MF.getFunction().getCallingConv()) {

83 default: [[fallthrough]];

88 }

89 }

90

96

100 }

101}

102

104

105

106

107 MF.ensureAlignment(Align(256));

108

110

114 OutStreamer->switchSection(ConfigSection);

115

116 EmitProgramInfoR600(MF);

117

119

123 OutStreamer->switchSection(CommentSection);

124

128 }

129

130 return false;

131}

R600 Assembly printer class.

#define R_0288E8_SQ_LDS_ALLOC

#define S_02880C_KILL_ENABLE(x)

#define R_028868_SQ_PGM_RESOURCES_VS

#define R_028878_SQ_PGM_RESOURCES_GS

#define R_02880C_DB_SHADER_CONTROL

#define R_028860_SQ_PGM_RESOURCES_VS

#define R_0288D4_SQ_PGM_RESOURCES_LS

#define R_028850_SQ_PGM_RESOURCES_PS

#define R_028844_SQ_PGM_RESOURCES_PS

Provides R600 specific target descriptions.

AMDGPU R600 specific subclass of TargetSubtarget.

uint32_t getLDSSize() const

This class is intended to be used as a driving class for all asm writers.

const TargetLoweringObjectFile & getObjFileLowering() const

Return information about object file lowering.

TargetMachine & TM

Target machine description.

MachineFunction * MF

The current machine function.

virtual void SetupMachineFunction(MachineFunction &MF)

This should be called when a new MachineFunction is being processed from runOnMachineFunction.

void emitFunctionBody()

This method emits the body and trailer for a function.

AsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer, char &ID=AsmPrinter::ID)

std::unique_ptr< MCStreamer > OutStreamer

This is the MCStreamer object for the file we are generating.

bool isVerbose() const

Return true if assembly output should contain comments.

Context object for machine code objects.

MCContext & getContext() const

This represents a section on linux, lots of unix variants and some bare metal systems.

const TargetSubtargetInfo & getSubtarget() const

getSubtarget - Return the subtarget for which this machine code is being compiled.

Ty * getInfo()

getInfo - Keep track of various per-function pieces of information for backends that would like to do...

Representation of each machine instruction.

MachineOperand class - Representation of each machine instruction operand.

bool isReg() const

isReg - Tests if this is a MO_Register operand.

Register getReg() const

getReg - Returns the register number.

bool runOnMachineFunction(MachineFunction &MF) override

Emit the specified function out to the OutStreamer.

Definition R600AsmPrinter.cpp:103

StringRef getPassName() const override

getPassName - Return a nice clean name for a pass.

Definition R600AsmPrinter.cpp:40

R600AsmPrinter(TargetMachine &TM, std::unique_ptr< MCStreamer > Streamer)

Definition R600AsmPrinter.cpp:36

const R600RegisterInfo * getRegisterInfo() const override

Generation getGeneration() const

StringRef - Represent a constant reference to a string, i.e.

Primary interface to the complete machine description for the target machine.

Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...

LLVM_READNONE constexpr bool isCompute(CallingConv::ID CC)

@ AMDGPU_CS

Used for Mesa/AMDPAL compute shaders.

@ AMDGPU_VS

Used for Mesa vertex shaders, or AMDPAL last shader stage before rasterization (vertex shader if tess...

@ AMDGPU_GS

Used for Mesa/AMDPAL geometry shaders.

@ AMDGPU_PS

Used for Mesa/AMDPAL pixel shaders.

This is an optimization pass for GlobalISel generic memory operations.

AsmPrinter * createR600AsmPrinterPass(TargetMachine &TM, std::unique_ptr< MCStreamer > &&Streamer)

Definition R600AsmPrinter.cpp:31

uint64_t alignTo(uint64_t Size, Align A)

Returns a multiple of A needed to store Size bytes.

OutputIt move(R &&Range, OutputIt Out)

Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.

Implement std::hash so that hash_code can be used in STL containers.

This struct is a compact representation of a valid (non-zero power of two) alignment.