Go to the documentation of this file.
34 #define DEBUG_TYPE "asm-printer"
40 std::unique_ptr<MCStreamer> Streamer)
43 StringRef getPassName()
const override {
return "BPF Assembly Printer"; }
44 bool doInitialization(
Module &
M)
override;
58 bool BPFAsmPrinter::doInitialization(
Module &M) {
62 if (MAI->doesSupportDebugInformation() && !
M.debug_compile_units().empty()) {
64 Handlers.push_back(HandlerInfo(std::unique_ptr<BTFDebug>(BTF),
"emit",
65 "Debug Info Emission",
"BTF",
110 bool BPFAsmPrinter::PrintAsmOperand(
const MachineInstr *
MI,
unsigned OpNo,
112 if (ExtraCode && ExtraCode[0])
120 unsigned OpNum,
const char *ExtraCode,
122 assert(OpNum + 1 <
MI->getNumOperands() &&
"Insufficient operands");
125 assert(BaseMO.
isReg() &&
"Unexpected base pointer for inline asm memory operand.");
126 assert(OffsetMO.
isImm() &&
"Unexpected offset for inline asm memory operand.");
143 if (!BTF || !BTF->InstLower(
MI, TmpInst)) {
145 MCInstLowering.Lower(
MI, TmpInst);
147 EmitToStreamer(*OutStreamer, TmpInst);
Target & getTheBPFleTarget()
@ MO_BlockAddress
Address of a basic block.
@ MO_Immediate
Immediate operand.
This is an optimization pass for GlobalISel generic memory operations.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
const GlobalValue * getGlobal() const
const BlockAddress * getBlockAddress() const
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
Instances of this class represent a single low-level machine instruction.
@ MO_Register
Register operand.
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
@ MO_GlobalAddress
Address of a global value.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
static const char * getRegisterName(unsigned RegNo)
MachineOperand class - Representation of each machine instruction operand.
This class implements an extremely fast bulk output stream that can only output to a stream.
StringRef getName() const
getName - Get the symbol name.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
Collect and emit BTF information.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Representation of each machine instruction.
#define LLVM_EXTERNAL_VISIBILITY
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFAsmPrinter()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Primary interface to the complete machine description for the target machine.
Target & getTheBPFbeTarget()
Register getReg() const
getReg - Returns the register number.
A Module instance is used to store all the information related to an LLVM module.
@ MO_JumpTableIndex
Address of indexed Jump Table for switch.
MachineBasicBlock * getMBB() const
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ MO_MachineBasicBlock
MachineBasicBlock reference.
@ MO_ExternalSymbol
Name of external global symbol.
This class is intended to be used as a driving class for all asm writers.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
Target & getTheBPFTarget()
const char * getSymbolName() const
const char LLVMTargetMachineRef TM
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.