LLVM: lib/Target/PowerPC/PPCMCInstLower.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

32using namespace llvm;

33

37

38

41 }

42

44

48

50 MCSymbol *Sym = Ctx.getOrCreateSymbol(Name);

51 return Sym;

52}

53

58

60

61 switch (access) {

64 break;

67 break;

70 break;

73 break;

76 break;

79 break;

82 break;

83 }

84

88

105 assert(MO.isGlobal() && "Only expecting a global MachineOperand here!");

108

109

110

111

116

117

121 }

122

125

126 unsigned MIOpcode = MI->getOpcode();

128 "BL8_NOTOC is only valid when using PC Relative Calls.");

130 if (MIOpcode == PPC::TAILB || MIOpcode == PPC::TAILB8 ||

131 MIOpcode == PPC::TCRETURNdi || MIOpcode == PPC::TCRETURNdi8 ||

132 MIOpcode == PPC::BL8_NOTOC || MIOpcode == PPC::BL8_NOTOC_RM) {

134 }

137 }

138

140

144 Expr =

146

150 Ctx);

151

152

157

160 }

161

162

163 switch (access) {

167 break;

171 break;

172 }

173

175}

176

187

191 default:

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

196 MO.getReg() < PPC::NUM_TARGET_REGS &&

197 "Invalid register for this target!");

198

200 OutMO =

202 return true;

203 }

204

206 return false;

208 return true;

211 return true;

215 return true;

219 return true;

222 return true;

225 return true;

227 OutMO =

229 return true;

232 return true;

234 return false;

235 }

236}

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

MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL

dxil pretty DXIL Metadata Pretty Printer

Module.h This file contains the declarations for the Module class.

static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol, AsmPrinter &Printer)

Definition PPCMCInstLower.cpp:54

static MCSymbol * GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP)

Definition PPCMCInstLower.cpp:34

PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)

This file defines the SmallString class.

This file describes how to lower LLVM code to machine code.

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

MCSymbol * getSymbol(const GlobalValue *GV) const

virtual MCSymbol * GetCPISymbol(unsigned CPID) const

Return the symbol for the specified constant pool entry.

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

Return the symbol for the specified jump table entry.

MCContext & OutContext

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

MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const

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

const DataLayout & getDataLayout() const

Return information about data layout.

A parsed version of the target data layout string in and methods for querying it.

Module * getParent()

Get the module that this global value is contained inside of...

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

static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)

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

Context object for machine code objects.

Base class for the full range of assembler expressions which are needed for parsing.

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 const MCSpecifierExpr * create(const MCExpr *Expr, Spec S, MCContext &Ctx, SMLoc Loc=SMLoc())

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.

const MachineFunction * getParent() const

Return the MachineFunction containing this basic block.

MCSymbol * getPICBaseSymbol() const

getPICBaseSymbol - Return a function-local symbol to represent the PIC base.

const TargetSubtargetInfo & getSubtarget() const

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

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.

const MachineBasicBlock * getParent() const

MachineOperand class - Representation of each machine instruction operand.

unsigned getSubReg() const

const GlobalValue * getGlobal() const

MachineBasicBlock * getMBB() const

bool isSymbol() const

isSymbol - Tests if this is a MO_ExternalSymbol operand.

bool isJTI() const

isJTI - Tests if this is a MO_JumpTableIndex operand.

const BlockAddress * getBlockAddress() const

MachineInstr * getParent()

getParent - Return the instruction that this operand belongs to.

unsigned getTargetFlags() const

bool isGlobal() const

isGlobal - Tests if this is a MO_GlobalAddress operand.

MachineOperandType getType() const

getType - Returns the MachineOperandType for this operand.

const char * getSymbolName() const

Register getReg() const

getReg - Returns the register number.

MCSymbol * getMCSymbol() const

@ MO_Immediate

Immediate operand.

@ MO_ConstantPoolIndex

Address of indexed Constant in Constant Pool.

@ MO_MCSymbol

MCSymbol reference (for debug/eh info)

@ 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.

int64_t getOffset() const

Return the offset from the symbol in this operand.

LLVM_ABI void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const

Print the appropriate prefix and the specified global variable's name.

A Module instance is used to store all the information related to an LLVM module.

PPCFunctionInfo - This class is derived from MachineFunction private PowerPC target-specific informat...

bool isAIXFuncUseTLSIEForLD() const

bool isUsingPCRelativeCalls() const

SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...

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

TLSModel::Model getTLSModel(const GlobalValue *GV) const

Returns the TLS model which should be used for the given global variable.

bool isPositionIndependent() const

#define llvm_unreachable(msg)

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

@ MO_PIC_LO_FLAG

MO_PIC_LO_FLAG = MO_PIC_FLAG | MO_LO.

@ MO_TPREL_PCREL_FLAG

MO_TPREL_PCREL_FLAG = MO_PCREL_FLAG | MO_TPREL_FLAG.

@ MO_GOT_TPREL_PCREL_FLAG

MO_GOT_TPREL_PCREL_FLAG - A combintaion of flags, if these bits are set they should produce the reloc...

@ MO_GOT_PCREL_FLAG

MO_GOT_PCREL_FLAG = MO_PCREL_FLAG | MO_GOT_FLAG.

@ MO_PCREL_FLAG

MO_PCREL_FLAG - If this bit is set, the symbol reference is relative to the current instruction addre...

@ MO_TLSLD_FLAG

MO_TLSLD_FLAG - If this bit is set the symbol reference is relative to TLS Local Dynamic model.

@ MO_TLS_PCREL_FLAG

MO_TPREL_PCREL_FLAG = MO_PCREL_FLAG | MO_TLS.

@ MO_PLT

On PPC, the 12 bits are not enough for all target operand flags.

@ MO_DTPREL_LO

These values identify relocations on immediates folded into memory operations.

@ MO_TLS

Symbol for VK_TLS fixup attached to an ADD instruction.

@ MO_TPREL_FLAG

MO_TPREL_FLAG - If this bit is set, the symbol reference is relative to the thread pointer and the sy...

@ MO_LO

MO_LO, MO_HA - lo16(symbol) and ha16(symbol)

@ MO_GOT_TLSLD_PCREL_FLAG

MO_GOT_TLSLD_PCREL_FLAG - A combintaion of flags, if these bits are set they should produce the reloc...

@ MO_PIC_HA_FLAG

MO_PIC_HA_FLAG = MO_PIC_FLAG | MO_HA.

@ MO_GOT_TLSGD_PCREL_FLAG

MO_GOT_TLSGD_PCREL_FLAG - A combintaion of flags, if these bits are set they should produce the reloc...

@ MO_PIC_FLAG

MO_PIC_FLAG - If this bit is set, the symbol reference is relative to the function's picbase,...

@ MO_PCREL_OPT_FLAG

MO_PCREL_OPT_FLAG - If this bit is set the operand is part of a PC Relative linker optimization.

static bool isDMRROWpRegister(unsigned Reg)

This is an optimization pass for GlobalISel generic memory operations.

bool LowerPPCMachineOperandToMCOperand(const MachineOperand &MO, MCOperand &OutMO, AsmPrinter &AP)

Definition PPCMCInstLower.cpp:188

void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, AsmPrinter &AP)

Definition PPCMCInstLower.cpp:177