39 cl::desc(
"Disable machine peepholes for BPF"));
43 cl::desc(
"Disable Trap Unreachable for BPF"));
70 std::optional<Reloc::Model>
RM,
71 std::optional<CodeModel::Model> CM,
77 Subtarget(TT,
std::string(CPU),
std::string(FS), *this) {
101 void addIRPasses()
override;
102 bool addInstSelector()
override;
103 void addMachineSSAOptimization()
override;
104 void addPreEmitPass()
override;
106 bool addIRTranslator()
override;
107 bool addLegalizeMachineIR()
override;
108 bool addRegBankSelect()
override;
109 bool addGlobalInstructionSelect()
override;
114 return new BPFPassConfig(*
this, PM);
117void BPFPassConfig::addIRPasses() {
131bool BPFPassConfig::addInstSelector() {
137void BPFPassConfig::addMachineSSAOptimization() {
144 const BPFSubtarget *Subtarget = getBPFTargetMachine().getSubtargetImpl();
151void BPFPassConfig::addPreEmitPass() {
159bool BPFPassConfig::addIRTranslator() {
164bool BPFPassConfig::addLegalizeMachineIR() {
169bool BPFPassConfig::addRegBankSelect() {
174bool 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)
This file provides the interface for the pass responsible for both simplifying and canonicalizing the...
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,...