38 cl::desc(
"Disable machine peepholes for BPF"));
56 return "E-m:e-p:64:64-i64:64-i128:128-n32:64-S128";
58 return "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128";
68 std::optional<Reloc::Model> RM,
69 std::optional<CodeModel::Model> CM,
91 return getTM<BPFTargetMachine>();
94 void addIRPasses()
override;
95 bool addInstSelector()
override;
96 void addMachineSSAOptimization()
override;
97 void addPreEmitPass()
override;
99 bool addIRTranslator()
override;
100 bool addLegalizeMachineIR()
override;
101 bool addRegBankSelect()
override;
102 bool addGlobalInstructionSelect()
override;
107 return new BPFPassConfig(*
this, PM);
112 "BPFPreserveStaticOffsetPass");
116#define GET_PASS_REGISTRY "BPFPassRegistry.def"
145void BPFPassConfig::addIRPasses() {
159bool BPFPassConfig::addInstSelector() {
165void BPFPassConfig::addMachineSSAOptimization() {
172 const BPFSubtarget *Subtarget = getBPFTargetMachine().getSubtargetImpl();
179void BPFPassConfig::addPreEmitPass() {
186bool BPFPassConfig::addIRTranslator() {
191bool BPFPassConfig::addLegalizeMachineIR() {
196bool BPFPassConfig::addRegBankSelect() {
201bool BPFPassConfig::addGlobalInstructionSelect() {
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFTarget()
static Expected< bool > parseBPFPreserveStaticOffsetOptions(StringRef Params)
static Reloc::Model getEffectiveRelocModel(std::optional< Reloc::Model > RM)
static cl::opt< bool > DisableMIPeephole("disable-bpf-peephole", cl::Hidden, cl::desc("Disable machine peepholes for BPF"))
#define LLVM_EXTERNAL_VISIBILITY
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This file declares the IRTranslator pass.
This header defines various interfaces for pass management in LLVM.
static std::string computeDataLayout()
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)
This file describes the interface of the MachineFunctionPass responsible for assigning the generic vi...
This file provides the interface for the pass responsible for both simplifying and canonicalizing the...
Target-Independent Code Generator Pass Configuration Options pass.
void setDwarfUsesRelocationsAcrossSections(bool enable)
bool getUseDwarfRIS() const
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
void registerPassBuilderCallbacks(PassBuilder &PB) override
Allow the target to modify the pass pipeline.
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
Get a TargetTransformInfo implementation for the target.
implements a set of functionality in the TargetMachine class for targets that make use of the indepen...
Tagged union holding either a T or a Error.
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...
This class provides access to building LLVM's passes.
void registerPipelineEarlySimplificationEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel, ThinOrFullLTOPhase)> &C)
Register a callback for a default optimizer pipeline extension point.
void registerPipelineStartEPCallback(const std::function< void(ModulePassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
void registerPeepholeEPCallback(const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
void registerScalarOptimizerLateEPCallback(const std::function< void(FunctionPassManager &, OptimizationLevel)> &C)
Register a callback for a default optimizer pipeline extension point.
static Expected< bool > parseSinglePassOption(StringRef Params, StringRef OptionName, StringRef PassName)
Handle passes only accept one bool-valued parameter.
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same_v< PassT, PassManager > > addPass(PassT &&Pass)
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static 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.
A pass to simplify and canonicalize the CFG of a function.
StringRef - Represent a constant reference to a string, i.e.
std::unique_ptr< const MCAsmInfo > AsmInfo
Contains target specific asm information.
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.
FunctionPass * createBPFMISimplifyPatchablePass()
ModuleToFunctionPassAdaptor createModuleToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
FunctionPass * createBPFMIPreEmitCheckingPass()
Target & getTheBPFleTarget()
ModulePass * createBPFCheckAndAdjustIR()
FunctionPass * createBPFMIPreEmitPeepholePass()
void initializeBPFMIPeepholePass(PassRegistry &)
FunctionPass * createBPFMIPeepholePass()
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
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()
Target & getTheBPFTarget()
CodeGenOptLevel
Code generation optimization level.
void initializeGlobalISel(PassRegistry &)
Initialize all passes linked into the GlobalISel library.
void initializeBPFCheckAndAdjustIRPass(PassRegistry &)
FunctionPass * createBPFISelDag(BPFTargetMachine &TM)
FunctionPass * createAtomicExpandLegacyPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
void initializeBPFDAGToDAGISelLegacyPass(PassRegistry &)
Implement std::hash so that hash_code can be used in STL containers.
RegisterTargetMachine - Helper template for registering a target machine implementation,...