|
LLVM 24.0.0git
|
#include "llvm/Transforms/Scalar/ConstantHoisting.h"#include "ScalarOptions.h"#include "llvm/ADT/APInt.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/BlockFrequencyInfo.h"#include "llvm/Analysis/ProfileSummaryInfo.h"#include "llvm/Analysis/TargetTransformInfo.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Function.h"#include "llvm/IR/InstrTypes.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Operator.h"#include "llvm/IR/Value.h"#include "llvm/InitializePasses.h"#include "llvm/Pass.h"#include "llvm/Support/BlockFrequency.h"#include "llvm/Support/Casting.h"#include "llvm/Support/Debug.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Transforms/Scalar.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/SizeOpts.h"#include <cassert>#include <iterator>#include <tuple>#include <utility>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "consthoist" |
Functions | |
| 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, SetVector< BasicBlock * > &BBs) |
Given BBs as input, find another set of BBs which collectively dominates BBs and have the minimal sum of frequencies. | |
| static bool | updateOperand (Instruction *Inst, unsigned Idx, Instruction *Mat) |
| Updates the operand at Idx in instruction Inst with the result of instruction Mat. | |
Variables | |
| consthoist | |
| Constant | Hoisting |
| Constant | false |
| #define DEBUG_TYPE "consthoist" |
Definition at line 73 of file ConstantHoisting.cpp.
|
static |
Given BBs as input, find another set of BBs which collectively dominates BBs and have the minimal sum of frequencies.
Return the BB set found in BBs.
Definition at line 197 of file ConstantHoisting.cpp.
References assert(), llvm::DomTreeNodeBase< NodeT >::children(), llvm::SetVector< T, Vector, Set, N >::clear(), llvm::SetVector< T, Vector, Set, N >::count(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::DomTreeNodeBase< NodeT >::getBlock(), llvm::BlockFrequencyInfo::getBlockFreq(), llvm::DomTreeNodeBase< NodeT >::getIDom(), llvm::DominatorTreeBase< NodeT, IsPostDom >::getNode(), llvm::SetVector< T, Vector, Set, N >::insert(), llvm::SetVector< T, Vector, Set, N >::insert_range(), llvm::SmallPtrSetImpl< PtrType >::insert_range(), isCandidate(), llvm::DominatorTree::isReachableFromEntry(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::reverse(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::try_emplace().
| INITIALIZE_PASS_BEGIN | ( | ConstantHoistingLegacyPass | , |
| "consthoist" | , | ||
| "Constant Hoisting" | , | ||
| false | , | ||
| false | ) |
References INITIALIZE_PASS_DEPENDENCY.
| STATISTIC | ( | NumConstantsHoisted | , |
| "Number of constants hoisted" | ) |
| STATISTIC | ( | NumConstantsRebased | , |
| "Number of constants rebased" | ) |
References llvm::PassRegistry::getPassRegistry().
|
static |
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 from the same incoming basic block is required.
Definition at line 696 of file ConstantHoisting.cpp.
References llvm::dyn_cast(), PHI, and llvm::User::setOperand().
| consthoist |
Definition at line 116 of file ConstantHoisting.cpp.
| Constant false |
Definition at line 117 of file ConstantHoisting.cpp.
| Constant Hoisting |
Definition at line 117 of file ConstantHoisting.cpp.