Go to the source code of this file.
|
| STATISTIC (NumConstantsHoisted, "Number of constants hoisted") |
|
| STATISTIC (NumConstantsRebased, "Number of constants rebased") |
|
| INITIALIZE_PASS_BEGIN (ConstantHoistingLegacyPass, "consthoist", "Constant Hoisting", false, false) INITIALIZE_PASS_END(ConstantHoistingLegacyPass |
|
static void | findBestInsertionSet (DominatorTree &DT, BlockFrequencyInfo &BFI, BasicBlock *Entry, SmallPtrSet< BasicBlock *, 8 > &BBs) |
| Given BBs as input, find another set of BBs which collectively dominates BBs and have the minimal sum of frequencies. More...
|
|
static Optional< APInt > | calculateOffsetDiff (const APInt &V1, const APInt &V2) |
|
static bool | updateOperand (Instruction *Inst, unsigned Idx, Instruction *Mat) |
| Updates the operand at Idx in instruction Inst with the result of instruction Mat. More...
|
|
◆ DEBUG_TYPE
#define DEBUG_TYPE "consthoist" |
◆ calculateOffsetDiff()
Definition at line 508 of file ConstantHoisting.cpp.
References llvm::consthoist::ConstantInfo::BaseExpr, llvm::consthoist::ConstantInfo::BaseInt, llvm::consthoist::ConstantCandidate::ConstInt, llvm::dbgs(), E, llvm::ConstantInt::get(), llvm::IntegerType::getBitWidth(), llvm::APInt::getBitWidth(), llvm::APInt::getLimitedValue(), llvm::APInt::getSExtValue(), llvm::ConstantInt::getType(), llvm::ConstantInt::getValue(), llvm::Optional< T >::getValue(), LLVM_DEBUG, llvm::None, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::consthoist::ConstantInfo::RebasedConstants, SI, and llvm::APInt::ult().
◆ findBestInsertionSet()
◆ INITIALIZE_PASS_BEGIN()
INITIALIZE_PASS_BEGIN |
( |
ConstantHoistingLegacyPass |
, |
|
|
"consthoist" |
, |
|
|
"Constant Hoisting" |
, |
|
|
false |
, |
|
|
false |
|
|
) |
| |
◆ STATISTIC() [1/2]
STATISTIC |
( |
NumConstantsHoisted |
, |
|
|
"Number of constants hoisted" |
|
|
) |
| |
◆ STATISTIC() [2/2]
STATISTIC |
( |
NumConstantsRebased |
, |
|
|
"Number of constants rebased" |
|
|
) |
| |
◆ updateOperand()
Updates the operand at Idx in instruction Inst with the result of instruction Mat.
If the instruction is a PHI node then special handling for duplicate values form the same incoming basic block is required.
- Returns
- The update will always succeed, but the return value indicated if Mat was used for the update or not.
Definition at line 699 of file ConstantHoisting.cpp.
References llvm::MCID::Add, assert(), llvm::consthoist::ConstantInfo::BaseExpr, llvm::consthoist::ConstantInfo::BaseInt, llvm::Instruction::clone(), llvm::BinaryOperator::Create(), llvm::GetElementPtrInst::Create(), llvm::dbgs(), llvm::SmallPtrSetImplBase::empty(), llvm::Instruction::eraseFromParent(), llvm::ConstantInt::get(), llvm::ConstantExpr::getAsInstruction(), llvm::Instruction::getDebugLoc(), llvm::PointerType::getElementType(), llvm::Type::getInt32Ty(), llvm::Type::getInt8PtrTy(), llvm::DILocation::getMergedLocation(), llvm::Value::getName(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::ConstantInt::getType(), llvm::Value::getType(), I, llvm::consthoist::ConstantUser::Inst, llvm::Instruction::isCast(), llvm::ConstantExpr::isCast(), llvm::ConstantExpr::isGEPWithNoNotionalOverIndexing(), LLVM_DEBUG, MinNumOfDependentToRebase, llvm::consthoist::ConstantUser::OpndIdx, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::consthoist::ConstantInfo::RebasedConstants, llvm::Instruction::setDebugLoc(), llvm::User::setOperand(), llvm::SmallVectorBase::size(), llvm::Value::use_empty(), and llvm::Instruction::user_back().
◆ consthoist
◆ ConstHoistGEP
◆ ConstHoistWithBlockFrequency
cl::opt<bool> ConstHoistWithBlockFrequency("consthoist-with-block-frequency", cl::init(true), cl::Hidden, cl::desc("Enable the use of the block frequency analysis to reduce the " "chance to execute const materialization more frequently than " "without hoisting.")) |
|
static |
◆ false
◆ Hoisting
◆ MinNumOfDependentToRebase
cl::opt<unsigned> MinNumOfDependentToRebase("consthoist-min-num-to-rebase", cl::desc("Do not rebase if number of dependent constants of a Base is less " "than this number."), cl::init(0), cl::Hidden) |
|
static |