14 #ifndef LLVM_TRANSFORMS_SCALAR_JUMPTHREADING_H 15 #define LLVM_TRANSFORMS_SCALAR_JUMPTHREADING_H 44 class TargetLibraryInfo;
50 namespace jumpthreading {
82 std::unique_ptr<BlockFrequencyInfo>
BFI;
83 std::unique_ptr<BranchProbabilityInfo> BPI;
84 bool HasProfileData =
false;
85 bool HasGuards =
false;
92 unsigned BBDupThreshold;
100 std::unique_ptr<BlockFrequencyInfo> BFI_,
101 std::unique_ptr<BranchProbabilityInfo> BPI_);
112 bool MaybeMergeBasicBlockIntoOnlyPred(
BasicBlock *BB);
124 bool DuplicateCondBranchOnPHIIntoPred(
127 bool ComputeValueKnownInPredecessorsImpl(
130 DenseSet<std::pair<Value *, BasicBlock *>> &RecursionSet,
138 return ComputeValueKnownInPredecessorsImpl(V, BB, Result, Preference,
146 bool ProcessBranchOnPHI(
PHINode *PN);
150 bool SimplifyPartiallyRedundantLoad(
LoadInst *LI);
156 bool TryToUnfoldSelectInCurrBB(
BasicBlock *BB);
167 bool doesBlockHaveProfileData(
BasicBlock *BB);
172 #endif // LLVM_TRANSFORMS_SCALAR_JUMPTHREADING_H
This class is the base class for the comparison instructions.
static bool runImpl(Function &F, TargetLibraryInfo &TLI, DominatorTree &DT)
This is the entry point for all transforms.
This class represents lattice values for constants.
Implements a dense probed hash-table based set.
An instruction for reading from memory.
This class represents the LLVM 'select' instruction.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
A CRTP mix-in to automatically provide informational APIs needed for passes.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
static bool ProcessBlock(BasicBlock &BB, DominatorTree &DT, LoopInfo &LI, AAResults &AA)
bool ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB, jumpthreading::PredValueInfo &Result, jumpthreading::ConstantPreference Preference, Instruction *CxtI=nullptr)
A set of analyses that are preserved following a run of a transformation pass.
LLVM Basic Block Representation.
Conditional or Unconditional Branch instruction.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Provides information about what library functions are available for the current target.
This pass performs 'jump threading', which looks at blocks that have multiple predecessors and multip...
InstListType::iterator iterator
Instruction iterators...
Helper struct that represents how a value is mapped through different register banks.
This pass computes, caches, and vends lazy value constraint information.
LLVM Value Representation.
A container for analyses that lazily runs them and caches their results.
A wrapper class for inspecting calls to intrinsic functions.