LLVM: lib/Target/X86/X86InstrBuilder.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23#ifndef LLVM_LIB_TARGET_X86_X86INSTRBUILDER_H

24#define LLVM_LIB_TARGET_X86_X86INSTRBUILDER_H

25

34#include

35

36namespace llvm {

37

38

39

40

41

44

51

57 bool CP = false;

58

61

64 false, false, false, 0, false));

65 else {

68 }

69

72 false, false, 0, false));

73

74 if (GV)

76 else

78

80 false, 0, false));

81 }

82};

83

84

85

87 unsigned Operand) {

90 if (Op0.isReg()) {

93 } else {

96 }

97

100

103

107 else

109

110 return AM;

111}

112

113

114

115

116

117static inline const MachineInstrBuilder &

123

124

125

128

129 MI->getOperand(Operand).ChangeToRegister(Reg, false);

130 MI->getOperand(Operand + 1).setImm(1);

131 MI->getOperand(Operand + 2).setReg(0);

132 MI->getOperand(Operand + 3).ChangeToImmediate(0);

133 MI->getOperand(Operand + 4).setReg(0);

134}

135

136static inline const MachineInstrBuilder &

140

141static inline const MachineInstrBuilder &

145

146

147

148

149

150static inline const MachineInstrBuilder &

155

156

157

158static inline const MachineInstrBuilder &

160 unsigned SubReg1, Register Reg2, bool isKill2, unsigned SubReg2) {

166}

167

168static inline const MachineInstrBuilder &

172

175 else {

178 }

179

181 if (AM.GV)

183 else

185

186 return MIB.addReg(0);

187}

188

189

190

191

192

193

194static inline const MachineInstrBuilder &

201 if (MCID.mayLoad())

203 if (MCID.mayStore())

210}

211

212

213

214

215

216

217

218

219static inline const MachineInstrBuilder &

221 Register GlobalBaseReg, unsigned char OpFlags) {

222

225}

226

227}

228

229#endif

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

BaseType

A given derived pointer can have multiple base pointers through phi/selects.

This file defines the SmallVector class.

Describe properties that are true of each instruction in the target description file.

The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.

Align getObjectAlign(int ObjectIdx) const

Return the alignment of the specified stack object.

int64_t getObjectSize(int ObjectIdx) const

Return the size of the specified object.

MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, LLT MemTy, Align base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)

getMachineMemOperand - Allocate a new MachineMemOperand.

MachineFrameInfo & getFrameInfo()

getFrameInfo - Return the frame info object for the current function.

const MachineInstrBuilder & addImm(int64_t Val) const

Add a new immediate operand.

const MachineInstrBuilder & add(const MachineOperand &MO) const

const MachineInstrBuilder & addFrameIndex(int Idx) const

const MachineInstrBuilder & addConstantPoolIndex(unsigned Idx, int Offset=0, unsigned TargetFlags=0) const

const MachineInstrBuilder & addGlobalAddress(const GlobalValue *GV, int64_t Offset=0, unsigned TargetFlags=0) const

const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const

Add a new virtual register operand.

const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const

Representation of each machine instruction.

A description of a memory reference used in the backend.

@ MOLoad

The memory access reads data.

@ MOStore

The memory access writes data.

MachineOperand class - Representation of each machine instruction operand.

const GlobalValue * getGlobal() const

bool isReg() const

isReg - Tests if this is a MO_Register operand.

static MachineOperand CreateImm(int64_t Val)

bool isGlobal() const

isGlobal - Tests if this is a MO_GlobalAddress operand.

Register getReg() const

getReg - Returns the register number.

static MachineOperand CreateGA(const GlobalValue *GV, int64_t Offset, unsigned TargetFlags=0)

static MachineOperand CreateReg(Register Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false, bool isRenamable=false)

static MachineOperand CreateFI(int Idx)

Wrapper class representing virtual and physical registers.

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

void push_back(const T &Elt)

This is an optimization pass for GlobalISel generic memory operations.

static const MachineInstrBuilder & addConstantPoolReference(const MachineInstrBuilder &MIB, unsigned CPI, Register GlobalBaseReg, unsigned char OpFlags)

addConstantPoolReference - This function is used to add a reference to the base of a constant value s...

Definition X86InstrBuilder.h:220

static const MachineInstrBuilder & addRegReg(const MachineInstrBuilder &MIB, Register Reg1, bool isKill1, unsigned SubReg1, Register Reg2, bool isKill2, unsigned SubReg2)

addRegReg - This function is used to add a memory reference of the form: [Reg + Reg].

Definition X86InstrBuilder.h:159

static const MachineInstrBuilder & addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset=0, bool mem=true)

addFrameReference - This function is used to add a reference to the base of an abstract object on the...

static const MachineInstrBuilder & addFullAddress(const MachineInstrBuilder &MIB, const X86AddressMode &AM)

Definition X86InstrBuilder.h:169

static void setDirectAddressInInstr(MachineInstr *MI, unsigned Operand, Register Reg)

Replace the address used in the instruction with the direct memory reference.

Definition X86InstrBuilder.h:126

static const MachineInstrBuilder & addOffset(const MachineInstrBuilder &MIB, int Offset)

Definition X86InstrBuilder.h:137

unsigned getKillRegState(bool B)

static X86AddressMode getAddressFromInstr(const MachineInstr *MI, unsigned Operand)

Compute the addressing mode from an machine instruction starting with the given operand.

Definition X86InstrBuilder.h:86

static const MachineInstrBuilder & addDirectMem(const MachineInstrBuilder &MIB, Register Reg)

addDirectMem - This function is used to add a direct memory reference to the current instruction – th...

Definition X86InstrBuilder.h:118

static const MachineInstrBuilder & addRegOffset(const MachineInstrBuilder &MIB, Register Reg, bool isKill, int Offset)

addRegOffset - This function is used to add a memory reference of the form [Reg + Offset],...

Definition X86InstrBuilder.h:151

static LLVM_ABI MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)

Return a MachinePointerInfo record that refers to the specified FrameIndex.

X86AddressMode - This struct holds a generalized full x86 address mode.

Definition X86InstrBuilder.h:42

Register IndexReg

Definition X86InstrBuilder.h:53

unsigned GVOpFlags

Definition X86InstrBuilder.h:56

@ RegBase

Definition X86InstrBuilder.h:43

@ FrameIndexBase

Definition X86InstrBuilder.h:43

void getFullAddress(SmallVectorImpl< MachineOperand > &MO)

Definition X86InstrBuilder.h:59

const GlobalValue * GV

Definition X86InstrBuilder.h:55

int Disp

Definition X86InstrBuilder.h:54

unsigned Scale

Definition X86InstrBuilder.h:52

union llvm::X86AddressMode::BaseUnion Base

bool CP

Definition X86InstrBuilder.h:57

enum llvm::X86AddressMode::@202116273335065351270200035056227005202106004277 BaseType

BaseUnion()

Definition X86InstrBuilder.h:49

int FrameIndex

Definition X86InstrBuilder.h:47

Register Reg

Definition X86InstrBuilder.h:46