69 #define DEBUG_TYPE "mips-asm-printer" 85 it = MipsFI->StubsNeeded.begin();
86 it != MipsFI->StubsNeeded.end(); ++it) {
87 const char *
Symbol = it->first;
89 if (StubsNeeded.find(Symbol) == StubsNeeded.end())
90 StubsNeeded[Symbol] = Signature;
96 NaClAlignIndirectJumpTargets(MF);
110 #include "MipsGenMCPseudoLowering.inc" 116 bool HasLinkReg =
false;
172 const MCExpr *OffsetExpr =
203 if (InConstantPool && Opc != Mips::CONSTPOOL_ENTRY) {
205 InConstantPool =
false;
207 if (Opc == Mips::CONSTPOOL_ENTRY) {
219 if (!InConstantPool) {
221 InConstantPool =
true;
235 case Mips::PATCHABLE_FUNCTION_ENTER:
238 case Mips::PATCHABLE_FUNCTION_EXIT:
241 case Mips::PATCHABLE_TAIL_CALL:
256 if (emitPseudoExpansionLowering(*OutStreamer, &*I))
259 if (I->getOpcode() == Mips::PseudoReturn ||
260 I->getOpcode() == Mips::PseudoReturn64 ||
261 I->getOpcode() == Mips::PseudoIndirectBranch ||
262 I->getOpcode() == Mips::PseudoIndirectBranch64 ||
263 I->getOpcode() == Mips::TAILCALLREG ||
264 I->getOpcode() == Mips::TAILCALLREG64) {
265 emitPseudoIndirectBranch(*OutStreamer, &*I);
277 && !isLongBranchPseudo(I->getOpcode()))
283 }
while ((++I != E) && I->isInsideBundle());
325 unsigned CPUBitmask = 0, FPUBitmask = 0;
326 int CPUTopSavedRegOff, FPUTopSavedRegOff;
336 bool HasAFGR64Reg =
false;
337 unsigned CSFPRegsSize = 0;
339 for (
const auto &
I : CSI) {
340 unsigned Reg =
I.getReg();
345 if (Mips::FGR32RegClass.
contains(Reg)) {
346 FPUBitmask |= (1 << RegNum);
347 CSFPRegsSize += FGR32RegSize;
348 }
else if (Mips::AFGR64RegClass.
contains(Reg)) {
349 FPUBitmask |= (3 << RegNum);
350 CSFPRegsSize += AFGR64RegSize;
352 }
else if (Mips::GPR32RegClass.
contains(Reg))
353 CPUBitmask |= (1 << RegNum);
357 FPUTopSavedRegOff = FPUBitmask ?
358 (HasAFGR64Reg ? -AFGR64RegSize : -FGR32RegSize) : 0;
361 CPUTopSavedRegOff = CPUBitmask ? -CSFPRegsSize - CPURegSize : 0;
365 TS.
emitMask(CPUBitmask, CPUTopSavedRegOff);
368 TS.
emitFMask(FPUBitmask, FPUTopSavedRegOff);
383 getTargetStreamer().
emitFrame(stackReg, stackSize, returnReg);
388 switch (static_cast<MipsTargetMachine &>(
TM).getABI().GetEnumValue()) {
428 if (!IsNakedFunction)
431 if (!IsNakedFunction)
459 InConstantPool =
false;
481 if (isa<SwitchInst>(bb->getTerminator()))
507 while (I != Pred->
begin() && !(--
I)->isTerminator()) ;
509 return !I->isBarrier();
514 unsigned AsmVariant,
const char *ExtraCode,
517 if (ExtraCode && ExtraCode[0]) {
518 if (ExtraCode[1] != 0)
return true;
521 switch (ExtraCode[0]) {
567 if (!FlagsOP.
isImm())
569 unsigned Flags = FlagsOP.
getImm();
582 unsigned RegOp = OpNum;
586 switch(ExtraCode[0]) {
620 unsigned OpNum,
unsigned AsmVariant,
621 const char *ExtraCode,
626 assert(BaseMO.isReg() &&
"Unexpected base pointer for inline asm memory operand.");
627 assert(OffsetMO.
isImm() &&
"Unexpected offset for inline asm memory operand.");
632 switch (ExtraCode[0]) {
717 if (closeP) O <<
")";
754 const char *Modifier) {
762 if (i != opNum) O <<
", ";
816 if ((ABI.
IsO32() && (STI.isABI_FPXX() || STI.isFP64bit())) ||
823 if (ABI.
IsO32() && (!STI.useOddSPReg() || STI.isABI_FPXX()))
827 void MipsAsmPrinter::emitInlineAsmStart()
const {
843 void MipsAsmPrinter::emitInlineAsmEnd(
const MCSubtargetInfo &StartInfo,
857 void MipsAsmPrinter::EmitInstrReg(
const MCSubtargetInfo &STI,
unsigned Opcode,
866 unsigned Opcode,
unsigned Reg1,
874 if (Opcode == Mips::MTC1) {
875 unsigned Temp = Reg1;
886 unsigned Opcode,
unsigned Reg1,
887 unsigned Reg2,
unsigned Reg3) {
897 unsigned MovOpc,
unsigned Reg1,
898 unsigned Reg2,
unsigned FPReg1,
899 unsigned FPReg2,
bool LE) {
901 unsigned temp = Reg1;
905 EmitInstrRegReg(STI, MovOpc, Reg1, FPReg1);
906 EmitInstrRegReg(STI, MovOpc, Reg2, FPReg2);
911 bool LE,
bool ToFP) {
912 using namespace Mips16HardFloatInfo;
914 unsigned MovOpc = ToFP ? Mips::MTC1 : Mips::MFC1;
917 EmitInstrRegReg(STI, MovOpc, Mips::A0, Mips::F12);
920 EmitMovFPIntPair(STI, MovOpc, Mips::A0, Mips::A1, Mips::F12, Mips::F14, LE);
923 EmitInstrRegReg(STI, MovOpc, Mips::A0, Mips::F12);
924 EmitMovFPIntPair(STI, MovOpc, Mips::A2, Mips::A3, Mips::F14, Mips::F15, LE);
927 EmitMovFPIntPair(STI, MovOpc, Mips::A0, Mips::A1, Mips::F12, Mips::F13, LE);
930 EmitMovFPIntPair(STI, MovOpc, Mips::A0, Mips::A1, Mips::F12, Mips::F13, LE);
931 EmitMovFPIntPair(STI, MovOpc, Mips::A2, Mips::A3, Mips::F14, Mips::F15, LE);
934 EmitMovFPIntPair(STI, MovOpc, Mips::A0, Mips::A1, Mips::F12, Mips::F13, LE);
935 EmitInstrRegReg(STI, MovOpc, Mips::A2, Mips::F14);
942 void MipsAsmPrinter::EmitSwapFPIntRetval(
945 using namespace Mips16HardFloatInfo;
947 unsigned MovOpc = Mips::MFC1;
950 EmitInstrRegReg(STI, MovOpc, Mips::V0, Mips::F0);
953 EmitMovFPIntPair(STI, MovOpc, Mips::V0, Mips::V1, Mips::F0, Mips::F1, LE);
956 EmitMovFPIntPair(STI, MovOpc, Mips::V0, Mips::V1, Mips::F0, Mips::F1, LE);
959 EmitMovFPIntPair(STI, MovOpc, Mips::V0, Mips::V1, Mips::F0, Mips::F1, LE);
960 EmitMovFPIntPair(STI, MovOpc, Mips::A0, Mips::A1, Mips::F2, Mips::F3, LE);
967 void MipsAsmPrinter::EmitFPCallStub(
969 using namespace Mips16HardFloatInfo;
991 switch (Signature->
RetSig) {
1002 RetType =
"double complex";
1014 Parms =
"float, float";
1017 Parms =
"float, double";
1023 Parms =
"double, double";
1026 Parms =
"double, float";
1032 OutStreamer->
AddComment(
"\t# Stub function to call " +
Twine(RetType) +
" " +
1061 std::string x =
"__call_stub_fp_" + std::string(Symbol);
1072 "should not be here if we are compiling pic");
1091 EmitSwapFPIntParams(*STI, Signature->
ParamSig, LE,
true);
1095 EmitJal(*STI, MSymbol);
1098 EmitSwapFPIntRetval(*STI, Signature->
RetSig, LE);
1104 EmitInstrReg(*STI, Mips::JR, Mips::S2);
1122 it = StubsNeeded.begin();
1123 it != StubsNeeded.end(); ++it) {
1124 const char *Symbol = it->first;
1126 EmitFPCallStub(Symbol, Signature);
1209 .addExpr(TargetExpr));
1211 for (int8_t
I = 0;
I < NoopsInSledCount;
I++)
1250 if (
auto *MipsExpr = dyn_cast<MipsMCExpr>(Value)) {
1273 const std::vector<MachineJumpTableEntry> &
JT = JtInfo->getJumpTables();
1274 for (
unsigned I = 0;
I < JT.size(); ++
I) {
1275 const std::vector<MachineBasicBlock*> &MBBs = JT[
I].MBBs;
1277 for (
unsigned J = 0; J < MBBs.size(); ++J)
1283 for (
auto &MBB : MF) {
1284 if (MBB.hasAddressTaken())
1289 bool MipsAsmPrinter::isLongBranchPseudo(
int Opcode)
const {
1290 return (Opcode == Mips::LONG_BRANCH_LUi
1291 || Opcode == Mips::LONG_BRANCH_LUi2Op
1292 || Opcode == Mips::LONG_BRANCH_LUi2Op_64
1293 || Opcode == Mips::LONG_BRANCH_ADDiu
1294 || Opcode == Mips::LONG_BRANCH_ADDiu2Op
1295 || Opcode == Mips::LONG_BRANCH_DADDiu
1296 || Opcode == Mips::LONG_BRANCH_DADDiu2Op);
unsigned getTargetFlags() const
MachineConstantPoolValue * MachineCPVal
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff)
StringRef getTargetFeatureString() const
bool isDebugLabel() const
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
bool isCall(QueryType Type=AnyInBundle) const
instr_iterator instr_end()
MachineBasicBlock * getMBB() const
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
This class represents lattice values for constants.
StringRef getPrivateGlobalPrefix() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
bool inMips16Mode() const
virtual void AddBlankLine()
AddBlankLine - Emit a blank line to a .s file to pretty it up.
MO_HIGHER/HIGHEST - Represents the highest or higher half word of a 64-bit symbol address...
MCContext & OutContext
This is the context for the output file that we are streaming.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
static MCOperand createExpr(const MCExpr *Val)
void EmitFunctionBodyEnd() override
EmitFunctionBodyEnd - Targets can override this to emit stuff after the last basic block in the funct...
MO_TLSGD - Represents the offset into the global offset table at which.
void EmitDebugValue(const MCExpr *Value, unsigned Size) const override
Emit the directive and value for debug thread local expression.
unsigned getReg() const
getReg - Returns the register number.
Target & getTheMipselTarget()
virtual void EmitDTPRel64Value(const MCExpr *Value)
Emit the expression Value into the output as a dtprel (64-bit DTP relative) value.
virtual void emitDirectiveSetNoReorder()
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
A raw_ostream that writes to an SmallVector or SmallString.
bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const override
isBlockOnlyReachableByFallthough - Return true if the basic block has exactly one predecessor and the...
void PushSection()
Save the current and previous section on the section stack.
MachineBasicBlock reference.
unsigned const TargetRegisterInfo * TRI
MachineFunction * MF
The current machine function.
void Initialize(MCContext *C)
std::vector< MachineBasicBlock * >::const_iterator const_pred_iterator
void EmitFunctionBodyStart() override
EmitFunctionBodyStart - Targets can override this to emit stuff before the first basic block in the f...
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
virtual void EmitDebugValue(const MCExpr *Value, unsigned Size) const
Emit the directive and value for debug thread local expression.
void EmitFunctionEntryLabel() override
EmitFunctionEntryLabel - Emit the label that is the entrypoint for the function.
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, bool PrintSchedInfo=false)
Emit the given Instruction into the current section.
return AArch64::GPR64RegClass contains(Reg)
SI optimize exec mask operations pre RA
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
virtual void emitDirectiveSetMicroMips()
void recordSled(MCSymbol *Sled, const MachineInstr &MI, SledKind Kind, uint8_t Version=0)
bool isMachineConstantPoolEntry() const
isMachineConstantPoolEntry - Return true if the MachineConstantPoolEntry is indeed a target specific ...
static MCOperand createReg(unsigned Reg)
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
unsigned getNumOperands() const
Return the number of declared MachineOperands for this MachineInstruction.
virtual void emitFrame(unsigned StackReg, unsigned StackSize, unsigned ReturnReg)
unsigned getNumOperands() const
Retuns the total number of operands.
static void emitDirectiveRelocJalr(const MachineInstr &MI, MCContext &OutContext, TargetMachine &TM, MCStreamer &OutStreamer, const MipsSubtarget &Subtarget)
bool inMicroMipsMode() const
void LLVMInitializeMipsAsmPrinter()
virtual void emitDirectiveSetNoMacro()
Base class for the full range of assembler expressions which are needed for parsing.
virtual void emitDirectiveSetPush()
virtual void emitDirectiveEnd(StringRef Name)
This file contains the simple types necessary to represent the attributes associated with functions a...
unsigned getAlignment() const
getAlignment - Return the alignment (log2, not bytes) of the function.
Represent a reference to a symbol from inside an expression.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
virtual unsigned getFrameRegister(const MachineFunction &MF) const =0
Debug information queries.
MO_ABS_HI/LO - Represents the hi or low part of an absolute symbol address.
const MipsABIInfo & getABI() const
void emitXRayTable()
Emit a table with all XRay instrumentation points.
virtual void emitDirectiveModuleOddSPReg()
Context object for machine code objects.
virtual void AddComment(const Twine &T, bool EOL=true)
Add a textual comment.
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
bool isIndirectBranch(QueryType Type=AnyInBundle) const
Return true if this is an indirect branch, such as a branch through a register.
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
bool isPositionIndependent() const
virtual void EmitBasicBlockEnd(const MachineBasicBlock &MBB)
Targets can override this to emit stuff at the end of a basic block.
Target & getTheMips64Target()
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &O) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant...
void printRegisterList(const MachineInstr *MI, int opNum, raw_ostream &O)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
virtual void emitDirectiveModuleFP()
bool isLittleEndian() const
Layout endianness...
RegisterAsmPrinter - Helper template for registering a target specific assembly printer, for use in the target machine initialization function.
This class is a data container for one entry in a MachineConstantPool.
StringRef getTargetCPU() const
void PrintDebugValueComment(const MachineInstr *MI, raw_ostream &OS)
void EmitEndOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the end of their file...
amdgpu Simplify well known AMD library false Value * Callee
const std::string & str() const
Instances of this class represent a single low-level machine instruction.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
bool isTargetNaCl() const
MO_GPREL - Represents the offset from the current gp value to be used for the relocatable object file...
bool isReturn(QueryType Type=AnyInBundle) const
const Constant * ConstVal
virtual void setUsesMicroMips()
MCContext & getContext() const
Address of a global value.
Streaming machine code generation interface.
MO_GOT_CALL - Represents the offset into the global offset table at which the address of a call site ...
MCSymbol * createTempSymbol(bool CanBeUnnamed=true)
Create and return a new assembler temporary symbol with a unique but unspecified name.
Target & getTheMips64elTarget()
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
MCSymbol * CurrentFnSym
The symbol for the current function.
LLVM Basic Block Representation.
const MCAsmInfo * MAI
Target Asm Printer information.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
virtual void emitDirectiveSetNoMicroMips()
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
virtual void emitDirectiveSetMips16()
virtual void SwitchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
const GlobalValue * getGlobal() const
void printSavedRegsBitmask()
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant...
void EmitInstruction(const MachineInstr *MI) override
Targets should implement this to emit instructions.
static ManagedStatic< OptionRegistry > OR
virtual void emitDirectiveSetMacro()
virtual void emitDirectiveNaN2008()
void EmitAlignment(unsigned NumBits, const GlobalObject *GV=nullptr) const
Emit an alignment directive to the specified power of two boundary.
TargetMachine & TM
Target machine description.
static unsigned getNumOperandRegisters(unsigned Flag)
getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag...
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
void Lower(const MachineInstr *MI, MCInst &OutMI) const
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0)
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute)=0
Add the given Attribute to Symbol.
Address of a basic block.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const MCObjectFileInfo * getObjectFileInfo() const
const Triple & getTargetTriple() const
StringRef selectMipsCPU(const Triple &TT, StringRef CPU)
Select the Mips CPU for the given triple and cpu name.
self_iterator getIterator()
virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff)
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
const Target & getTarget() const
MipsMCInstLower MCInstLowering
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool isLittleEndian() const
pred_iterator pred_begin()
virtual MCSymbol * GetCPISymbol(unsigned CPID) const
Return the symbol for the specified constant pool entry.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MO_GOTTPREL - Represents the offset from the thread pointer (Initial.
virtual void EmitDataRegion(MCDataRegionType Kind)
Note in the output the specified region Kind.
Triple - Helper class for working with autoconf configuration names.
const std::vector< MachineConstantPoolEntry > & getConstants() const
cl::opt< bool > EmitJalrReloc
unsigned getFunctionNumber() const
Return a unique ID for the current function.
virtual void emitDirectiveAbiCalls()
MO_GOT - Represents the offset into the global offset table at which the address the relocation entry...
Iterator for intrusive lists based on ilist_node.
void setOpcode(unsigned Op)
MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const
Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.
virtual void emitDirectiveOptionPic0()
MCSymbol * getSymbol(const GlobalValue *GV) const
bool isDebugValue() const
MachineOperand class - Representation of each machine instruction operand.
virtual void EmitCodeAlignment(unsigned ByteAlignment, unsigned MaxBytesToEmit=0)
Emit nops until the byte alignment ByteAlignment is reached.
virtual void emitDirectiveSetPop()
virtual bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc, const MCSubtargetInfo &STI)
Emit a .reloc directive.
const MCSubtargetInfo * getMCSubtargetInfo() const
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
static Twine utohexstr(const uint64_t &Val)
virtual void emitDirectiveSetAt()
virtual void emitDirectiveSetNoMips16()
bool isLayoutSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB will be emitted immediately after this block, such that if this bloc...
const Function & getFunction() const
Return the LLVM function that this machine code represents.
void printFCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O, const char *Modifier=nullptr)
void EmitStartOfAsmFile(Module &M) override
This virtual method can be overridden by targets that want to emit something at the start of their fi...
virtual void emitDirectiveInsn()
const char * MipsFCCToString(Mips::CondCode CC)
Target - Wrapper for Target specific information.
union llvm::MachineConstantPoolEntry::@159 Val
The constant itself.
Target & getTheMipsTarget()
MCSubtargetInfo * createMCSubtargetInfo(StringRef TheTriple, StringRef CPU, StringRef Features) const
createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
MO_TPREL_HI/LO - Represents the hi and low part of the offset from.
const MachineBasicBlock * getParent() const
static const unsigned MIPS_NACL_BUNDLE_ALIGN
virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV)
const char * getCurrentABIString() const
Emit Set directives.
virtual void setPic(bool Value)
void printMemOperand(const MachineInstr *MI, int opNum, raw_ostream &O)
Representation of each machine instruction.
void updateABIInfo(const PredicateLibrary &P)
virtual void emitDirectiveEnt(const MCSymbol &Symbol)
uint16_t getEncodingValue(unsigned RegNo) const
Returns the encoding for RegNo.
const MipsSubtarget * Subtarget
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
bool isEHPad() const
Returns true if the block is a landing pad.
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
.type _foo, STT_FUNC # aka
int64_t getOffset() const
Return the offset from the symbol in this operand.
const BlockAddress * getBlockAddress() const
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
virtual void EmitDTPRel32Value(const MCExpr *Value)
Emit the expression Value into the output as a dtprel (32-bit DTP relative) value.
Generic base class for all target subtargets.
void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O)
virtual void emitELFSize(MCSymbol *Symbol, const MCExpr *Value)
Emit an ELF .size directive.
const BasicBlock * getBasicBlock() const
Return the LLVM basic block that this instance corresponded to originally.
void LowerPATCHABLE_FUNCTION_EXIT(const MachineInstr &MI)
MipsFunctionInfo - This class is derived from MachineFunction private Mips target-specific informatio...
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
This represents a section on linux, lots of unix variants and some bare metal systems.
MCOperand LowerOperand(const MachineOperand &MO, unsigned offset=0) const
unsigned getRARegister() const
This method should return the register where the return address can be found.
void printMemOperandEA(const MachineInstr *MI, int opNum, raw_ostream &O)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
StringRef getName() const
getName - Get the symbol name.
LLVM_NODISCARD std::string lower() const
MCSection * getTextSection() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool PopSection()
Restore the current and previous section from the section stack.
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
virtual void emitDirectiveSetReorder()
static const char * getRegisterName(unsigned RegNo)
MCSymbol * getMCSymbol() const
void EmitGlobalConstant(const DataLayout &DL, const Constant *CV)
Print a general LLVM constant to the .s file.
LLVM Value Representation.
void forbidModuleDirective()
virtual void emitDirectiveNaNLegacy()
virtual void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
This class implements an extremely fast bulk output stream that can only output to a stream...
Primary interface to the complete machine description for the target machine.
const DataLayout & getDataLayout() const
Return information about data layout.
const MipsFunctionInfo * MipsFI
void emitFrameDirective()
Frame Directive.
void addOperand(const MCOperand &Op)
StringRef - Represent a constant reference to a string, i.e.
void LowerPATCHABLE_TAIL_CALL(const MachineInstr &MI)
Address of indexed Constant in Constant Pool.
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum, unsigned AsmVariant, const char *ExtraCode, raw_ostream &O) override
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant as...
bool isPositionIndependent() const
unsigned getRegSizeInBits(const TargetRegisterClass &RC) const
Return the size in bits of a register from class RC.
virtual void emitDirectiveSetNoAt()
void EmitBasicBlockEnd(const MachineBasicBlock &MBB) override
Targets can override this to emit stuff at the end of a basic block.
void LowerPATCHABLE_FUNCTION_ENTER(const MachineInstr &MI)
Represents a location in source code.
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
const MachineOperand & getOperand(unsigned i) const
Instances of this class represent operands of the MCInst class.
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects...
unsigned Log2_64(uint64_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
Helper operand used to generate R_MIPS_JALR.
void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.