Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/Transforms/Scalar/JumpThreading.h
Show All 28 Lines | |||||
namespace llvm { | namespace llvm { | ||||
class BasicBlock; | class BasicBlock; | ||||
class BinaryOperator; | class BinaryOperator; | ||||
class BranchInst; | class BranchInst; | ||||
class CmpInst; | class CmpInst; | ||||
class Constant; | class Constant; | ||||
class DeferredDominance; | |||||
class Function; | class Function; | ||||
class Instruction; | class Instruction; | ||||
class IntrinsicInst; | class IntrinsicInst; | ||||
class LazyValueInfo; | class LazyValueInfo; | ||||
class LoadInst; | class LoadInst; | ||||
class PHINode; | class PHINode; | ||||
class TargetLibraryInfo; | class TargetLibraryInfo; | ||||
class Value; | class Value; | ||||
Show All 27 Lines | |||||
/// if (X < 3) { | /// if (X < 3) { | ||||
/// | /// | ||||
/// In this case, the unconditional branch at the end of the first if can be | /// In this case, the unconditional branch at the end of the first if can be | ||||
/// revectored to the false side of the second if. | /// revectored to the false side of the second if. | ||||
class JumpThreadingPass : public PassInfoMixin<JumpThreadingPass> { | class JumpThreadingPass : public PassInfoMixin<JumpThreadingPass> { | ||||
TargetLibraryInfo *TLI; | TargetLibraryInfo *TLI; | ||||
LazyValueInfo *LVI; | LazyValueInfo *LVI; | ||||
AliasAnalysis *AA; | AliasAnalysis *AA; | ||||
DeferredDominance *DDT; | |||||
std::unique_ptr<BlockFrequencyInfo> BFI; | std::unique_ptr<BlockFrequencyInfo> BFI; | ||||
std::unique_ptr<BranchProbabilityInfo> BPI; | std::unique_ptr<BranchProbabilityInfo> BPI; | ||||
bool HasProfileData = false; | bool HasProfileData = false; | ||||
bool HasGuards = false; | bool HasGuards = false; | ||||
#ifdef NDEBUG | #ifdef NDEBUG | ||||
SmallPtrSet<const BasicBlock *, 16> LoopHeaders; | SmallPtrSet<const BasicBlock *, 16> LoopHeaders; | ||||
#else | #else | ||||
SmallSet<AssertingVH<const BasicBlock>, 16> LoopHeaders; | SmallSet<AssertingVH<const BasicBlock>, 16> LoopHeaders; | ||||
Show All 14 Lines | struct RecursionSetRemover { | ||||
~RecursionSetRemover() { TheSet.erase(ThePair); } | ~RecursionSetRemover() { TheSet.erase(ThePair); } | ||||
}; | }; | ||||
public: | public: | ||||
JumpThreadingPass(int T = -1); | JumpThreadingPass(int T = -1); | ||||
// Glue for old PM. | // Glue for old PM. | ||||
bool runImpl(Function &F, TargetLibraryInfo *TLI_, LazyValueInfo *LVI_, | bool runImpl(Function &F, TargetLibraryInfo *TLI_, LazyValueInfo *LVI_, | ||||
AliasAnalysis *AA_, bool HasProfileData_, | AliasAnalysis *AA_, DeferredDominance *DDT_, | ||||
std::unique_ptr<BlockFrequencyInfo> BFI_, | bool HasProfileData_, std::unique_ptr<BlockFrequencyInfo> BFI_, | ||||
std::unique_ptr<BranchProbabilityInfo> BPI_); | std::unique_ptr<BranchProbabilityInfo> BPI_); | ||||
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); | PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); | ||||
void releaseMemory() { | void releaseMemory() { | ||||
BFI.reset(); | BFI.reset(); | ||||
BPI.reset(); | BPI.reset(); | ||||
} | } | ||||
Show All 40 Lines |