|
LLVM
3.7.0
|
#include "llvm/Transforms/Scalar/LowerExpectIntrinsic.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/Constants.h"#include "llvm/IR/Function.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/MDBuilder.h"#include "llvm/IR/Metadata.h"#include "llvm/Pass.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Transforms/Scalar.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "lower-expect-intrinsic" |
Functions | |
| STATISTIC (ExpectIntrinsicsHandled,"Number of 'expect' intrinsic instructions handled") | |
| static bool | handleSwitchExpect (SwitchInst &SI) |
| static bool | handleBranchExpect (BranchInst &BI) |
| static bool | lowerExpectIntrinsic (Function &F) |
| INITIALIZE_PASS (LowerExpectIntrinsic,"lower-expect","Lower 'expect' Intrinsics", false, false) FunctionPass *llvm | |
Variables | |
| static cl::opt< uint32_t > | LikelyBranchWeight ("likely-branch-weight", cl::Hidden, cl::init(64), cl::desc("Weight of the branch likely to be taken (default = 64)")) |
| static cl::opt< uint32_t > | UnlikelyBranchWeight ("unlikely-branch-weight", cl::Hidden, cl::init(4), cl::desc("Weight of the branch unlikely to be taken (default = 4)")) |
| #define DEBUG_TYPE "lower-expect-intrinsic" |
Definition at line 32 of file LowerExpectIntrinsic.cpp.
|
static |
Definition at line 74 of file LowerExpectIntrinsic.cpp.
References llvm::dyn_cast(), llvm::CallInst::getArgOperand(), llvm::CallInst::getCalledFunction(), llvm::BranchInst::getCondition(), llvm::Value::getContext(), llvm::Function::getIntrinsicID(), llvm::User::getOperand(), llvm::CmpInst::getPredicate(), llvm::CmpInst::ICMP_NE, llvm::ConstantInt::isOne(), llvm::BranchInst::isUnconditional(), LikelyBranchWeight, llvm::LLVMContext::MD_prof, llvm::BranchInst::setCondition(), llvm::Instruction::setMetadata(), llvm::User::setOperand(), and UnlikelyBranchWeight.
Referenced by lowerExpectIntrinsic().
|
static |
Definition at line 44 of file LowerExpectIntrinsic.cpp.
References llvm::SwitchInst::case_default(), llvm::dyn_cast(), llvm::SwitchInst::findCaseValue(), llvm::CallInst::getArgOperand(), llvm::CallInst::getCalledFunction(), llvm::SwitchInst::CaseIteratorT< SwitchInstTy, ConstantIntTy, BasicBlockTy >::getCaseIndex(), llvm::SwitchInst::getCondition(), llvm::Value::getContext(), llvm::Function::getIntrinsicID(), llvm::SwitchInst::getNumCases(), LikelyBranchWeight, llvm::LLVMContext::MD_prof, llvm::SwitchInst::setCondition(), llvm::Instruction::setMetadata(), and UnlikelyBranchWeight.
Referenced by lowerExpectIntrinsic().
| INITIALIZE_PASS | ( | LowerExpectIntrinsic | , |
| "lower-expect" | , | ||
| "Lower 'expect' Intrinsics" | , | ||
| false | , | ||
| false | |||
| ) |
Definition at line 187 of file LowerExpectIntrinsic.cpp.
Definition at line 129 of file LowerExpectIntrinsic.cpp.
References llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::CallInst::getArgOperand(), llvm::CallInst::getCalledFunction(), llvm::Function::getIntrinsicID(), handleBranchExpect(), handleSwitchExpect(), llvm::Value::replaceAllUsesWith(), and SI.
Referenced by llvm::LowerExpectIntrinsicPass::run().
| STATISTIC | ( | ExpectIntrinsicsHandled | , |
| "Number of 'expect' intrinsic instructions handled" | |||
| ) |
|
static |
Referenced by handleBranchExpect(), and handleSwitchExpect().
|
static |
Referenced by handleBranchExpect(), and handleSwitchExpect().
1.8.6