LLVM: lib/Target/ARM/ARMMCInstLower.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

33#include

34#include

35

36using namespace llvm;

37

43

46 default:

49 break;

53 break;

57 break;

61 break;

65 break;

69 break;

73 break;

74 }

75

82

83}

84

90

92 return false;

93 assert(!MO.getSubReg() && "Subregs should be eliminated!");

95 break;

98 break;

102 break;

104 MCOp = GetSymbolRef(MO,

106 break;

108 MCOp = GetSymbolRef(MO,

110 break;

113 break;

116 "execute-only should not generate constant pools");

118 break;

121 break;

124 bool ignored;

127 break;

128 }

130

131 return false;

132 }

133 return true;

134}

135

139

140

141 bool EncodeImms = false;

142 switch (MI->getOpcode()) {

143 default: break;

144 case ARM::MOVi:

145 case ARM::MVNi:

146 case ARM::CMPri:

147 case ARM::CMNri:

148 case ARM::TSTri:

149 case ARM::TEQri:

150 case ARM::MSRi:

151 case ARM::ADCri:

152 case ARM::ADDri:

153 case ARM::ADDSri:

154 case ARM::SBCri:

155 case ARM::SUBri:

156 case ARM::SUBSri:

157 case ARM::ANDri:

158 case ARM::ORRri:

159 case ARM::EORri:

160 case ARM::BICri:

161 case ARM::RSBri:

162 case ARM::RSBSri:

163 case ARM::RSCri:

164 EncodeImms = true;

165 break;

166 }

167

171 if (MCOp.isImm() && EncodeImms) {

173 if (Enc != -1)

175 }

177 }

178 }

179}

180

181void ARMAsmPrinter::EmitSled(const MachineInstr &MI, SledKind Kind)

182{

187 Fn,

188 "An attempt to perform XRay instrumentation for a Thumb function (not "

189 "supported). Detected when emitting a sled.",

190 MI.getDebugLoc()));

191 return;

192 }

193 static const int8_t NoopsInSledCount = 6;

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

214 auto CurSled = OutContext.createTempSymbol("xray_sled_", true);

217

218

219

220

221

222

225

227

230}

231

236

241

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

This file declares a class to represent arbitrary precision floating point values and provide a varie...

This file contains the declarations for the subclasses of Constant, which represent the different fla...

static constexpr roundingMode rmTowardZero

static const fltSemantics & IEEEdouble()

LLVM_ABI opStatus convert(const fltSemantics &ToSemantics, roundingMode RM, bool *losesInfo)

LLVM_ABI double convertToDouble() const

Converts this APFloat to host double value.

MCSymbol * GetCPISymbol(unsigned CPID) const override

Return the symbol for the specified constant pool entry.

bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp)

Definition ARMMCInstLower.cpp:85

void LowerPATCHABLE_FUNCTION_EXIT(const MachineInstr &MI)

Definition ARMMCInstLower.cpp:237

void LowerPATCHABLE_FUNCTION_ENTER(const MachineInstr &MI)

Definition ARMMCInstLower.cpp:232

void LowerPATCHABLE_TAIL_CALL(const MachineInstr &MI)

Definition ARMMCInstLower.cpp:242

ARMFunctionInfo - This class is derived from MachineFunctionInfo and contains private ARM-specific in...

bool isThumbFunction() const

void emitNops(unsigned N)

Emit N NOP instructions.

void EmitToStreamer(MCStreamer &S, const MCInst &Inst)

MachineFunction * MF

The current machine function.

MCSymbol * GetJTISymbol(unsigned JTID, bool isLinkerPrivate=false) const

Return the symbol for the specified jump table entry.

void recordSled(MCSymbol *Sled, const MachineInstr &MI, SledKind Kind, uint8_t Version=0)

MCContext & OutContext

This is the context for the output file that we are streaming.

std::unique_ptr< MCStreamer > OutStreamer

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

MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const

Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.

MCSymbol * GetExternalSymbolSymbol(const Twine &Sym) const

Return the MCSymbol for the specified ExternalSymbol.

const MCSubtargetInfo & getSubtargetInfo() const

Return information about subtarget.

const APFloat & getValueAPF() const

Diagnostic information for unsupported feature in backend.

LLVMContext & getContext() const

getContext - Return a reference to the LLVMContext associated with this function.

LLVM_ABI void diagnose(const DiagnosticInfo &DI)

Report a message to the currently installed diagnostic handler.

static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())

static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)

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

void addOperand(const MCOperand Op)

void setOpcode(unsigned Op)

Instances of this class represent operands of the MCInst class.

static MCOperand createExpr(const MCExpr *Val)

static MCOperand createReg(MCRegister Reg)

static MCOperand createImm(int64_t Val)

static MCOperand createDFPImm(uint64_t Val)

static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())

MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...

LLVM_ABI MCSymbol * getSymbol() const

Return the MCSymbol for this basic block.

Function & getFunction()

Return the LLVM function that this machine code represents.

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.

unsigned getSubReg() const

const GlobalValue * getGlobal() const

MachineBasicBlock * getMBB() const

bool isJTI() const

isJTI - Tests if this is a MO_JumpTableIndex operand.

const BlockAddress * getBlockAddress() const

unsigned getTargetFlags() const

MachineOperandType getType() const

getType - Returns the MachineOperandType for this operand.

const char * getSymbolName() const

Register getReg() const

getReg - Returns the register number.

const ConstantFP * getFPImm() const

@ MO_Immediate

Immediate operand.

@ MO_ConstantPoolIndex

Address of indexed Constant in Constant Pool.

@ MO_GlobalAddress

Address of a global value.

@ MO_RegisterMask

Mask of preserved registers.

@ MO_BlockAddress

Address of a basic block.

@ MO_MachineBasicBlock

MachineBasicBlock reference.

@ MO_Register

Register operand.

@ MO_ExternalSymbol

Name of external global symbol.

@ MO_JumpTableIndex

Address of indexed Jump Table for switch.

@ MO_FPImmediate

Floating-point immediate operand.

int64_t getOffset() const

Return the offset from the symbol in this operand.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

constexpr char Align[]

Key for Kernel::Arg::Metadata::mAlign.

@ MO_OPTION_MASK

MO_OPTION_MASK - Most flags are mutually exclusive; this mask selects just that part of the flag set.

@ MO_LO16

MO_LO16 - On a symbol operand, this represents a relocation containing lower 16 bit of the address.

@ MO_LO_0_7

MO_LO_0_7 - On a symbol operand, this represents a relocation containing bits 0 through 7 of the addr...

@ MO_LO_8_15

MO_LO_8_15 - On a symbol operand, this represents a relocation containing bits 8 through 15 of the ad...

@ MO_HI_8_15

MO_HI_8_15 - On a symbol operand, this represents a relocation containing bits 24 through 31 of the a...

@ MO_SBREL

MO_SBREL - On a symbol operand, this represents a static base relative relocation.

@ MO_HI16

MO_HI16 - On a symbol operand, this represents a relocation containing higher 16 bit of the address.

@ MO_HI_0_7

MO_HI_0_7 - On a symbol operand, this represents a relocation containing bits 16 through 23 of the ad...

int getSOImmVal(unsigned Arg)

getSOImmVal - Given a 32-bit immediate, if it is something that can fit into an shifter_operand immed...

const MCSpecifierExpr * createUpper0_7(const MCExpr *Expr, MCContext &Ctx)

const MCSpecifierExpr * createUpper8_15(const MCExpr *Expr, MCContext &Ctx)

const MCSpecifierExpr * createLower16(const MCExpr *Expr, MCContext &Ctx)

const MCSpecifierExpr * createLower0_7(const MCExpr *Expr, MCContext &Ctx)

const MCSpecifierExpr * createLower8_15(const MCExpr *Expr, MCContext &Ctx)

const MCSpecifierExpr * createUpper16(const MCExpr *Expr, MCContext &Ctx)

This is an optimization pass for GlobalISel generic memory operations.

void LowerARMMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, ARMAsmPrinter &AP)

Definition ARMMCInstLower.cpp:136

To bit_cast(const From &from) noexcept