LLVM  13.0.0git
BPF.h
Go to the documentation of this file.
1 //===-- BPF.h - Top-level interface for BPF representation ------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIB_TARGET_BPF_BPF_H
10 #define LLVM_LIB_TARGET_BPF_BPF_H
11 
13 #include "llvm/IR/PassManager.h"
15 
16 namespace llvm {
17 class BPFTargetMachine;
18 
19 ModulePass *createBPFAdjustOpt();
20 ModulePass *createBPFCheckAndAdjustIR();
21 
22 FunctionPass *createBPFAbstractMemberAccess(BPFTargetMachine *TM);
23 FunctionPass *createBPFPreserveDIType();
24 FunctionPass *createBPFISelDag(BPFTargetMachine &TM);
25 FunctionPass *createBPFMISimplifyPatchablePass();
26 FunctionPass *createBPFMIPeepholePass();
27 FunctionPass *createBPFMIPeepholeTruncElimPass();
28 FunctionPass *createBPFMIPreEmitPeepholePass();
29 FunctionPass *createBPFMIPreEmitCheckingPass();
30 
31 void initializeBPFAdjustOptPass(PassRegistry&);
32 void initializeBPFCheckAndAdjustIRPass(PassRegistry&);
33 
35 void initializeBPFPreserveDITypePass(PassRegistry&);
36 void initializeBPFMISimplifyPatchablePass(PassRegistry&);
37 void initializeBPFMIPeepholePass(PassRegistry&);
38 void initializeBPFMIPeepholeTruncElimPass(PassRegistry&);
39 void initializeBPFMIPreEmitPeepholePass(PassRegistry&);
40 void initializeBPFMIPreEmitCheckingPass(PassRegistry&);
41 
43  : public PassInfoMixin<BPFAbstractMemberAccessPass> {
44  BPFTargetMachine *TM;
45 
46 public:
49 
50  static bool isRequired() { return true; }
51 };
52 
53 class BPFPreserveDITypePass : public PassInfoMixin<BPFPreserveDITypePass> {
54 public:
56 
57  static bool isRequired() { return true; }
58 };
59 
60 class BPFAdjustOptPass : public PassInfoMixin<BPFAdjustOptPass> {
61 public:
63 };
64 } // namespace llvm
65 
66 #endif
BPFMCTargetDesc.h
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:155
llvm
Definition: AllocatorList.h:23
M
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
Definition: README.txt:252
llvm::createBPFCheckAndAdjustIR
ModulePass * createBPFCheckAndAdjustIR()
llvm::BPFPreserveDITypePass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition: BPFPreserveDIType.cpp:144
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:374
llvm::Function
Definition: Function.h:61
llvm::BPFAbstractMemberAccessPass
Definition: BPF.h:42
llvm::initializeBPFAbstractMemberAccessLegacyPassPass
void initializeBPFAbstractMemberAccessLegacyPassPass(PassRegistry &)
llvm::createBPFMIPeepholeTruncElimPass
FunctionPass * createBPFMIPeepholeTruncElimPass()
llvm::BPFPreserveDITypePass
Definition: BPF.h:53
llvm::createBPFPreserveDIType
FunctionPass * createBPFPreserveDIType()
llvm::createBPFMIPreEmitPeepholePass
FunctionPass * createBPFMIPreEmitPeepholePass()
llvm::createBPFAdjustOpt
ModulePass * createBPFAdjustOpt()
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::initializeBPFAdjustOptPass
void initializeBPFAdjustOptPass(PassRegistry &)
llvm::createBPFMIPreEmitCheckingPass
FunctionPass * createBPFMIPreEmitCheckingPass()
TargetMachine.h
llvm::initializeBPFMIPeepholePass
void initializeBPFMIPeepholePass(PassRegistry &)
llvm::BPFAbstractMemberAccessPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition: BPFAbstractMemberAccess.cpp:1119
llvm::initializeBPFPreserveDITypePass
void initializeBPFPreserveDITypePass(PassRegistry &)
llvm::initializeBPFMISimplifyPatchablePass
void initializeBPFMISimplifyPatchablePass(PassRegistry &)
llvm::initializeBPFMIPreEmitCheckingPass
void initializeBPFMIPreEmitCheckingPass(PassRegistry &)
llvm::initializeBPFCheckAndAdjustIRPass
void initializeBPFCheckAndAdjustIRPass(PassRegistry &)
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::createBPFISelDag
FunctionPass * createBPFISelDag(BPFTargetMachine &TM)
Definition: BPFISelDAGToDAG.cpp:496
llvm::createBPFMISimplifyPatchablePass
FunctionPass * createBPFMISimplifyPatchablePass()
llvm::createBPFAbstractMemberAccess
FunctionPass * createBPFAbstractMemberAccess(BPFTargetMachine *TM)
llvm::BPFTargetMachine
Definition: BPFTargetMachine.h:20
PassManager.h
llvm::createBPFMIPeepholePass
FunctionPass * createBPFMIPeepholePass()
llvm::initializeBPFMIPeepholeTruncElimPass
void initializeBPFMIPeepholeTruncElimPass(PassRegistry &)
llvm::BPFAbstractMemberAccessPass::isRequired
static bool isRequired()
Definition: BPF.h:50
llvm::BPFAdjustOptPass::run
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition: BPFAdjustOpt.cpp:324
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::BPFAdjustOptPass
Definition: BPF.h:60
llvm::initializeBPFMIPreEmitPeepholePass
void initializeBPFMIPreEmitPeepholePass(PassRegistry &)
llvm::BPFPreserveDITypePass::isRequired
static bool isRequired()
Definition: BPF.h:57
llvm::BPFAbstractMemberAccessPass::BPFAbstractMemberAccessPass
BPFAbstractMemberAccessPass(BPFTargetMachine *TM)
Definition: BPF.h:47