LLVM 22.0.0git
|
#include "BPF.h"
#include "BPFCORE.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/IntrinsicsBPF.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
Go to the source code of this file.
Classes | |
struct | MinMaxSinkInfo |
Macros | |
#define | DEBUG_TYPE "bpf-check-and-opt-ir" |
Functions | |
INITIALIZE_PASS (BPFCheckAndAdjustIR, DEBUG_TYPE, "BPF Check And Adjust IR", false, false) ModulePass *llvm | |
static bool | sinkMinMaxInBB (BasicBlock &BB, const std::function< bool(Instruction *)> &Filter) |
static void | unrollGEPLoad (CallInst *Call) |
static void | unrollGEPStore (CallInst *Call) |
static bool | removeGEPBuiltinsInFunc (Function &F) |
static Value * | aspaceWrapValue (DenseMap< Value *, Value * > &Cache, Function *F, Value *ToWrap) |
static void | aspaceWrapOperand (DenseMap< Value *, Value * > &Cache, Instruction *I, unsigned OpNum) |
static Value * | wrapPtrIfASNotZero (DenseMap< Value *, Value * > &Cache, CallInst *CI, Value *P) |
static Instruction * | aspaceMemSet (Intrinsic::ID ID, DenseMap< Value *, Value * > &Cache, CallInst *CI) |
static Instruction * | aspaceMemCpy (Intrinsic::ID ID, DenseMap< Value *, Value * > &Cache, CallInst *CI) |
static Instruction * | aspaceMemMove (DenseMap< Value *, Value * > &Cache, CallInst *CI) |
#define DEBUG_TYPE "bpf-check-and-opt-ir" |
Definition at line 37 of file BPFCheckAndAdjustIR.cpp.
|
static |
Definition at line 518 of file BPFCheckAndAdjustIR.cpp.
References B(), llvm::cast(), llvm::CallBase::getArgOperand(), MI, and wrapPtrIfASNotZero().
|
static |
Definition at line 543 of file BPFCheckAndAdjustIR.cpp.
References B(), llvm::cast(), llvm::CallBase::getArgOperand(), MI, and wrapPtrIfASNotZero().
|
static |
Definition at line 491 of file BPFCheckAndAdjustIR.cpp.
References B(), llvm::cast(), llvm::CallBase::getArgOperand(), MI, and wrapPtrIfASNotZero().
|
static |
Definition at line 461 of file BPFCheckAndAdjustIR.cpp.
References aspaceWrapValue(), llvm::dyn_cast(), llvm::Type::getPointerAddressSpace(), llvm::Value::getType(), and I.
|
static |
Definition at line 429 of file BPFCheckAndAdjustIR.cpp.
References aspaceWrapValue(), llvm::cast(), llvm::dyn_cast(), F, GEP, llvm::Value::getName(), llvm::PointerType::getUnqual(), and Ptr.
Referenced by aspaceWrapOperand(), aspaceWrapValue(), and wrapPtrIfASNotZero().
INITIALIZE_PASS | ( | BPFCheckAndAdjustIR | , |
DEBUG_TYPE | , | ||
"BPF Check And Adjust IR" | , | ||
false | , | ||
false | ) |
Definition at line 63 of file BPFCheckAndAdjustIR.cpp.
References llvm::createBPFCheckAndAdjustIR(), and DEBUG_TYPE.
Definition at line 384 of file BPFCheckAndAdjustIR.cpp.
References Call, llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), F, llvm::for_each(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), unrollGEPLoad(), and unrollGEPStore().
|
static |
Definition at line 186 of file BPFCheckAndAdjustIR.cpp.
References A(), assert(), B(), Call, Changed, llvm::dyn_cast(), llvm::Filter, llvm::First, llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::CmpInst::getSwappedPredicate(), I, Info, llvm::ICmpInst::isGE(), llvm::ICmpInst::isGT(), llvm::ICmpInst::isLE(), llvm::ICmpInst::isLT(), llvm::ICmpInst::isRelational(), llvm::CmpInst::isSigned(), LHS, P, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Value::replaceAllUsesWith(), RHS, ToRemove, and X.
|
static |
Definition at line 369 of file BPFCheckAndAdjustIR.cpp.
References Call, GEP, and llvm::BPFPreserveStaticOffsetPass::reconstructLoad().
Referenced by removeGEPBuiltinsInFunc().
|
static |
Definition at line 377 of file BPFCheckAndAdjustIR.cpp.
References Call, GEP, and llvm::BPFPreserveStaticOffsetPass::reconstructStore().
Referenced by removeGEPBuiltinsInFunc().
|
static |
Definition at line 482 of file BPFCheckAndAdjustIR.cpp.
References aspaceWrapValue(), llvm::dyn_cast(), llvm::Instruction::getFunction(), and P.
Referenced by aspaceMemCpy(), aspaceMemMove(), and aspaceMemSet().