LLVM: include/llvm/MCA/CustomBehaviour.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18#ifndef LLVM_MCA_CUSTOMBEHAVIOUR_H

19#define LLVM_MCA_CUSTOMBEHAVIOUR_H

20

28

29namespace llvm {

30namespace mca {

31

32

33

34

35

36

38protected:

41

42public:

45

47

48

49

50

51

53

54

55

56

58};

59

60

61

62

63

64

65

67protected:

71

72public:

76

78

79

80

81

82

83

84

85

86

87

88

89

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107 virtual std::vector<std::unique_ptr>

109

110 virtual std::vector<std::unique_ptr>

113

114 virtual std::vector<std::unique_ptr>

116};

117

119

121

122

124

125public:

127

129

131

134};

135

137 std::optional Latency;

138

139public:

142

143 Data = Data.trim();

144 if (Data.empty())

145 return;

146 unsigned L = 0;

147 if (!Data.getAsInteger(10, L))

148 Latency = L;

149 }

150

153};

154

156

157

158

159

161protected:

165

166public:

170

172

173

175

176

177

178 virtual bool supportsInstrumentType(StringRef Type) const;

179

180

181

182

184

185

186

187

189

190

191

192

193

194

195

196 virtual unsigned getSchedClassID(const MCInstrInfo &MCII, const MCInst &MCI,

198

199

201

202

205};

206

207}

208}

209

210#endif

Legalize the Machine IR a function s Machine IR

This file contains abstract class SourceMgr and the default implementation, CircularSourceMgr.

This file defines the SmallVector class.

This file defines the main interface for Views.

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

This is an instance of a target assembly language printer that converts an MCInst to valid target ass...

Instances of this class represent a single low-level machine instruction.

Interface to description of machine instruction set.

Generic base class for all target subtargets.

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

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

The instances of the Type class are immutable: once they are created, they are never changed.

virtual std::vector< std::unique_ptr< View > > getEndViews(llvm::MCInstPrinter &IP, llvm::ArrayRef< llvm::MCInst > Insts)

Return a vector of Views that will be added after all other Views.

const MCInstrInfo & MCII

Definition CustomBehaviour.h:70

virtual unsigned checkCustomHazard(ArrayRef< InstRef > IssuedInst, const InstRef &IR)

Before the llvm-mca pipeline dispatches an instruction, it first checks for any register or resource ...

virtual ~CustomBehaviour()

virtual std::vector< std::unique_ptr< View > > getPostInstrInfoViews(llvm::MCInstPrinter &IP, llvm::ArrayRef< llvm::MCInst > Insts)

Return a vector of Views that will be added after the InstructionInfoView.

const mca::SourceMgr & SrcMgr

Definition CustomBehaviour.h:69

const MCSubtargetInfo & STI

Definition CustomBehaviour.h:68

virtual std::vector< std::unique_ptr< View > > getStartViews(llvm::MCInstPrinter &IP, llvm::ArrayRef< llvm::MCInst > Insts)

Return a vector of Views that will be added before all other Views.

CustomBehaviour(const MCSubtargetInfo &STI, const mca::SourceMgr &SrcMgr, const MCInstrInfo &MCII)

Definition CustomBehaviour.h:73

An InstRef contains both a SourceMgr index and Instruction pair.

virtual ~InstrPostProcess()=default

virtual void postProcessInstruction(Instruction &Inst, const MCInst &MCI)

This method can be overriden by targets to modify the mca::Instruction object after it has been lower...

Definition CustomBehaviour.h:52

const MCSubtargetInfo & STI

Definition CustomBehaviour.h:39

const MCInstrInfo & MCII

Definition CustomBehaviour.h:40

InstrPostProcess(const MCSubtargetInfo &STI, const MCInstrInfo &MCII)

Definition CustomBehaviour.h:43

virtual void resetState()

Definition CustomBehaviour.h:57

An instruction propagated through the simulated instruction pipeline.

InstrumentManager(const MCSubtargetInfo &STI, const MCInstrInfo &MCII, bool EnableInstruments=true)

Definition CustomBehaviour.h:167

const MCInstrInfo & MCII

Definition CustomBehaviour.h:163

bool EnableInstruments

Definition CustomBehaviour.h:164

virtual ~InstrumentManager()=default

virtual bool shouldIgnoreInstruments() const

Returns true if llvm-mca should ignore instruments.

Definition CustomBehaviour.h:174

const MCSubtargetInfo & STI

Definition CustomBehaviour.h:162

StringRef getData() const

Definition CustomBehaviour.h:133

Instrument(StringRef Desc, StringRef Data)

Definition CustomBehaviour.h:126

Instrument()

Definition CustomBehaviour.h:128

virtual ~Instrument()=default

StringRef getDesc() const

Definition CustomBehaviour.h:132

static const StringRef DESC_NAME

Definition CustomBehaviour.h:140

bool hasValue() const

Definition CustomBehaviour.h:151

unsigned getLatency() const

Definition CustomBehaviour.h:152

LatencyInstrument(StringRef Data)

Definition CustomBehaviour.h:141

std::unique_ptr< Instrument > UniqueInstrument

Definition CustomBehaviour.h:155

This is an optimization pass for GlobalISel generic memory operations.

FunctionAddr VTableAddr uintptr_t uintptr_t Data

An instruction descriptor.

Abstracting the input code sequence (a sequence of MCInst) and assigning unique identifiers to every ...