|
LLVM 23.0.0git
|
#include "BPF.h"#include "BPFCORE.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/IR/Analysis.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/PassManager.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" |
| #define DEBUG_TYPE "bpf-check-and-opt-ir" |
Definition at line 39 of file BPFCheckAndAdjustIR.cpp.
|
static |
Definition at line 650 of file BPFCheckAndAdjustIR.cpp.
References Changed, insertASpaceCasts(), removeCompareBuiltin(), removeGEPBuiltins(), removePassThroughBuiltin(), and sinkMinMax().
Referenced by llvm::BPFCheckAndAdjustIRPass::run().
|
static |
Definition at line 512 of file BPFCheckAndAdjustIR.cpp.
References B(), llvm::cast(), llvm::CallBase::getArgOperand(), MI, and wrapPtrIfASNotZero().
Referenced by insertASpaceCasts().
|
static |
Definition at line 537 of file BPFCheckAndAdjustIR.cpp.
References B(), llvm::cast(), llvm::CallBase::getArgOperand(), MI, and wrapPtrIfASNotZero().
Referenced by insertASpaceCasts().
|
static |
Definition at line 485 of file BPFCheckAndAdjustIR.cpp.
References B(), llvm::cast(), llvm::CallBase::getArgOperand(), MI, and wrapPtrIfASNotZero().
Referenced by insertASpaceCasts().
|
static |
Definition at line 455 of file BPFCheckAndAdjustIR.cpp.
References aspaceWrapValue(), llvm::dyn_cast(), llvm::Type::getPointerAddressSpace(), llvm::Value::getType(), and I.
Referenced by insertASpaceCasts().
|
static |
Definition at line 423 of file BPFCheckAndAdjustIR.cpp.
References aspaceWrapValue(), llvm::cast(), llvm::dyn_cast(), F, GEP, llvm::Value::getName(), and llvm::PointerType::getUnqual().
Referenced by aspaceWrapOperand(), aspaceWrapValue(), and wrapPtrIfASNotZero().
|
static |
Definition at line 63 of file BPFCheckAndAdjustIR.cpp.
References llvm::BPFCoreSharedInfo::AmaAttr, llvm::dyn_cast(), F, llvm::PHINode::getIncomingValue(), llvm::PHINode::getNumIncomingValues(), I, llvm::report_fatal_error(), llvm::BPFCoreSharedInfo::TypeIdAttr, and llvm::Value::use_empty().
Referenced by llvm::BPFCheckAndAdjustIRPass::run().
| INITIALIZE_PASS | ( | BPFCheckAndAdjustIRLegacy | , |
| DEBUG_TYPE | , | ||
| "BPF Check And Adjust IR" | , | ||
| false | , | ||
| false | ) |
Definition at line 56 of file BPFCheckAndAdjustIR.cpp.
References llvm::createBPFCheckAndAdjustIRLegacyPass(), and DEBUG_TYPE.
Definition at line 572 of file BPFCheckAndAdjustIR.cpp.
References aspaceMemCpy(), aspaceMemMove(), aspaceMemSet(), aspaceWrapOperand(), Changed, llvm::dyn_cast(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), F, G, I, and llvm::make_early_inc_range().
Referenced by adjustIR().
Definition at line 126 of file BPFCheckAndAdjustIR.cpp.
References Call, llvm::cast(), Changed, llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), F, and I.
Referenced by adjustIR().
Definition at line 407 of file BPFCheckAndAdjustIR.cpp.
References Changed, F, and removeGEPBuiltinsInFunc().
Referenced by adjustIR().
Definition at line 378 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().
Referenced by removeGEPBuiltins().
Definition at line 96 of file BPFCheckAndAdjustIR.cpp.
References Call, Changed, llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), F, and I.
Referenced by adjustIR().
|
static |
Definition at line 336 of file BPFCheckAndAdjustIR.cpp.
References Changed, F, llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor(), I, and sinkMinMaxInBB().
Referenced by adjustIR().
|
static |
Definition at line 179 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, 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.
Referenced by sinkMinMax().
|
static |
Definition at line 363 of file BPFCheckAndAdjustIR.cpp.
References Call, GEP, and llvm::BPFPreserveStaticOffsetPass::reconstructLoad().
Referenced by removeGEPBuiltinsInFunc().
|
static |
Definition at line 371 of file BPFCheckAndAdjustIR.cpp.
References Call, GEP, and llvm::BPFPreserveStaticOffsetPass::reconstructStore().
Referenced by removeGEPBuiltinsInFunc().
|
static |
Definition at line 476 of file BPFCheckAndAdjustIR.cpp.
References aspaceWrapValue(), llvm::dyn_cast(), llvm::Instruction::getFunction(), and P.
Referenced by aspaceMemCpy(), aspaceMemMove(), and aspaceMemSet().