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

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_MCA_INSTRBUILDER_H

15#define LLVM_MCA_INSTRBUILDER_H

16

28

29namespace llvm {

30namespace mca {

31

34

35public:

37

39

41

43

45 OS << "Instruction is recycled\n";

46 }

47

51};

52

53

54

55

56

57

58

59

60

61

62

63class InstrBuilder {

70

71

73 std::unique_ptr>

74 Descriptors;

75

76

77

79 VariantDescriptors;

80

81

82

84

85 bool FirstCallInst;

86 bool FirstReturnInst;

87 unsigned CallLatency;

88

90 InstRecycleCallback InstRecycleCB;

91

96 getOrCreateInstrDesc(const MCInst &MCI,

98

99 InstrBuilder(const InstrBuilder &) = delete;

100 InstrBuilder &operator=(const InstrBuilder &) = delete;

101

102 void populateWrites(InstrDesc &ID, const MCInst &MCI, unsigned SchedClassID);

103 void populateReads(InstrDesc &ID, const MCInst &MCI, unsigned SchedClassID);

105

106public:

110

112 Descriptors.clear();

113 VariantDescriptors.clear();

114 FirstCallInst = true;

115 FirstReturnInst = true;

116 }

117

118

119

121

124};

125}

126}

127

128#endif

This file defines the base class CustomBehaviour which can be inherited from by specific targets (ex.

This file defines abstractions used by the Pipeline to model register reads, register writes and inst...

Base class for user error types.

Lightweight error class with error context and mandatory checking.

Tagged union holding either a T or a Error.

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

Interface to description of machine instruction set.

MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...

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.

void clear()

Definition InstrBuilder.h:111

void setInstRecycleCallback(InstRecycleCallback CB)

Set a callback which is invoked to retrieve a recycled mca::Instruction or null if there isn't any.

Definition InstrBuilder.h:120

LLVM_ABI Expected< std::unique_ptr< Instruction > > createInstruction(const MCInst &MCI, const SmallVector< Instrument * > &IVec)

An instruction propagated through the simulated instruction pipeline.

This class allows targets to optionally customize the logic that resolves scheduling class IDs.

void log(raw_ostream &OS) const override

Print an error message to an output stream.

Definition InstrBuilder.h:44

Instruction * getInst() const

Definition InstrBuilder.h:42

RecycledInstErr(Instruction *Inst)

Definition InstrBuilder.h:38

std::error_code convertToErrorCode() const override

Convert this error to a std::error_code.

Definition InstrBuilder.h:48

static LLVM_ABI char ID

Definition InstrBuilder.h:36

This class implements an extremely fast bulk output stream that can only output to a stream.

Helper functions used by various pipeline components.

char InstructionError< T >::ID

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI std::error_code inconvertibleErrorCode()

The value returned by this function can be returned from convertToErrorCode for Error values where no...

An instruction descriptor.