37 cl::desc(
"Disable machine peepholes for BPF"));
41 cl::desc(
"Disable Trap Unreachable for BPF"));
68 std::optional<Reloc::Model>
RM,
69 std::optional<CodeModel::Model> CM,
75 Subtarget(TT,
std::string(CPU),
std::string(FS), *this) {
99 void addIRPasses()
override;
100 bool addInstSelector()
override;
101 void addMachineSSAOptimization()
override;
102 void addPreEmitPass()
override;
104 bool addIRTranslator()
override;
105 bool addLegalizeMachineIR()
override;
106 bool addRegBankSelect()
override;
107 bool addGlobalInstructionSelect()
override;
112 return new BPFPassConfig(*
this, PM);
115void BPFPassConfig::addIRPasses() {
129bool BPFPassConfig::addInstSelector() {
135void BPFPassConfig::addMachineSSAOptimization() {
142 const BPFSubtarget *Subtarget = getBPFTargetMachine().getSubtargetImpl();
149void BPFPassConfig::addPreEmitPass() {
157bool BPFPassConfig::addIRTranslator() {
162bool BPFPassConfig::addLegalizeMachineIR() {
167bool BPFPassConfig::addRegBankSelect() {
172bool BPFPassConfig::addGlobalInstructionSelect() {
static Reloc::Model getEffectiveRelocModel()
cl::opt< bool > DisableMIPeephole
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFTarget()
static cl::opt< bool > DisableCheckUnreachable("bpf-disable-trap-unreachable", cl::Hidden, cl::desc("Disable Trap Unreachable for BPF"))
cl::opt< bool > DisableMIPeephole("disable-bpf-peephole", cl::Hidden, cl::desc("Disable machine peepholes for BPF"))
#define LLVM_EXTERNAL_VISIBILITY
This file declares the IRTranslator pass.
This header defines various interfaces for pass management in LLVM.
This file describes the interface of the MachineFunctionPass responsible for assigning the generic vi...
const GCNTargetMachine & getTM(const GCNSubtarget *STI)
static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")
Target-Independent Code Generator Pass Configuration Options pass.
void setDwarfUsesRelocationsAcrossSections(bool enable)
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
BPFTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OL, bool JIT)
TargetTransformInfo getTargetTransformInfo(const Function &F) const override
Return a TargetTransformInfo for a given function.
CodeGenTargetMachineImpl(const Target &T, StringRef DataLayoutString, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOptLevel OL)
This pass is responsible for selecting generic machine instructions to target-specific instructions.
This class is intended to be used as a base class for asm properties and features specific to the tar...
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This pass implements the reg bank selector pass used in the GlobalISel pipeline.
Represent a constant reference to a string, i.e.
std::unique_ptr< const MCAsmInfo > AsmInfo
Contains target specific asm information.
unsigned NoTrapAfterNoreturn
Do not emit a trap instruction for 'unreachable' IR instructions behind noreturn calls,...
unsigned TrapUnreachable
Emit target-specific trap instruction for 'unreachable' IR instructions.
Target-Independent Code Generator Pass Configuration Options.
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
virtual void addMachineSSAOptimization()
addMachineSSAOptimization - Add standard passes that optimize machine instructions in SSA form.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Interfaces for registering analysis passes, producing common pass manager configurations,...
This is an optimization pass for GlobalISel generic memory operations.
void initializeBPFMISimplifyPatchableLegacyPass(PassRegistry &)
FunctionPass * createBPFMIPeepholeLegacyPass()
Target & getTheBPFleTarget()
FunctionPass * createBPFMIPreEmitCheckingLegacyPass()
static Reloc::Model getEffectiveRelocModel(std::optional< Reloc::Model > RM)
CodeModel::Model getEffectiveCodeModel(std::optional< CodeModel::Model > CM, CodeModel::Model Default)
Helper method for getting the code model, returning Default if CM does not have a value.
Target & getTheBPFbeTarget()
void initializeBPFAsmPrinterPass(PassRegistry &)
Target & getTheBPFTarget()
void initializeBPFMIPeepholeLegacyPass(PassRegistry &)
CodeGenOptLevel
Code generation optimization level.
void initializeBPFMIPreEmitCheckingLegacyPass(PassRegistry &)
LLVM_ABI void initializeGlobalISel(PassRegistry &)
Initialize all passes linked into the GlobalISel library.
void initializeBPFMIPreEmitPeepholeLegacyPass(PassRegistry &)
void initializeBPFMIExpandStackArgPseudosLegacyPass(PassRegistry &)
void initializeBPFCheckAndAdjustIRLegacyPass(PassRegistry &)
FunctionPass * createBPFISelDag(BPFTargetMachine &TM)
ModulePass * createBPFCheckAndAdjustIRLegacyPass()
FunctionPass * createBPFMISimplifyPatchableLegacyPass()
FunctionPass * createBPFMIPreEmitPeepholeLegacyPass()
LLVM_ABI FunctionPass * createAtomicExpandLegacyPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
void initializeBPFDAGToDAGISelLegacyPass(PassRegistry &)
FunctionPass * createBPFMIExpandStackArgPseudosLegacyPass()
Implement std::hash so that hash_code can be used in STL containers.
RegisterTargetMachine - Helper template for registering a target machine implementation,...