diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-07-04 19:20:19 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-02-08 19:02:26 +0000 |
commit | 81ad626541db97eb356e2c1d4a20eb2a26a766ab (patch) | |
tree | 311b6a8987c32b1e1dcbab65c54cfac3fdb56175 /contrib/llvm-project/llvm/lib/Transforms/Scalar/LoopFuse.cpp | |
parent | 5fff09660e06a66bed6482da9c70df328e16bbb6 (diff) | |
parent | 145449b1e420787bb99721a429341fa6be3adfb6 (diff) |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Transforms/Scalar/LoopFuse.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Transforms/Scalar/LoopFuse.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/LoopFuse.cpp index bf4d275e04ba..d94b767c7b63 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/LoopFuse.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/LoopFuse.cpp @@ -117,7 +117,7 @@ static cl::opt<FusionDependenceAnalysisChoice> FusionDependenceAnalysis( "Use the dependence analysis interface"), clEnumValN(FUSION_DEPENDENCE_ANALYSIS_ALL, "all", "Use all available analyses")), - cl::Hidden, cl::init(FUSION_DEPENDENCE_ANALYSIS_ALL), cl::ZeroOrMore); + cl::Hidden, cl::init(FUSION_DEPENDENCE_ANALYSIS_ALL)); static cl::opt<unsigned> FusionPeelMaxCount( "loop-fusion-peel-max-count", cl::init(0), cl::Hidden, @@ -128,7 +128,7 @@ static cl::opt<unsigned> FusionPeelMaxCount( static cl::opt<bool> VerboseFusionDebugging("loop-fusion-verbose-debug", cl::desc("Enable verbose debugging for Loop Fusion"), - cl::Hidden, cl::init(false), cl::ZeroOrMore); + cl::Hidden, cl::init(false)); #endif namespace { @@ -178,12 +178,12 @@ struct FusionCandidate { /// FusionCandidateCompare function, required by FusionCandidateSet to /// determine where the FusionCandidate should be inserted into the set. These /// are used to establish ordering of the FusionCandidates based on dominance. - const DominatorTree *DT; + DominatorTree &DT; const PostDominatorTree *PDT; OptimizationRemarkEmitter &ORE; - FusionCandidate(Loop *L, const DominatorTree *DT, + FusionCandidate(Loop *L, DominatorTree &DT, const PostDominatorTree *PDT, OptimizationRemarkEmitter &ORE, TTI::PeelingPreferences PP) : Preheader(L->getLoopPreheader()), Header(L->getHeader()), @@ -192,7 +192,6 @@ struct FusionCandidate { GuardBranch(L->getLoopGuardBranch()), PP(PP), AbleToPeel(canPeel(L)), Peeled(false), DT(DT), PDT(PDT), ORE(ORE) { - assert(DT && "Expected non-null DT!"); // Walk over all blocks in the loop and check for conditions that may // prevent fusion. For each block, walk over all instructions and collect // the memory reads and writes If any instructions that prevent fusion are @@ -391,7 +390,7 @@ struct FusionCandidateCompare { /// IF RHS dominates LHS and LHS post-dominates RHS, return false; bool operator()(const FusionCandidate &LHS, const FusionCandidate &RHS) const { - const DominatorTree *DT = LHS.DT; + const DominatorTree *DT = &(LHS.DT); BasicBlock *LHSEntryBlock = LHS.getEntryBlock(); BasicBlock *RHSEntryBlock = RHS.getEntryBlock(); @@ -646,7 +645,7 @@ private: for (Loop *L : LV) { TTI::PeelingPreferences PP = gatherPeelingPreferences(L, SE, TTI, None, None); - FusionCandidate CurrCand(L, &DT, &PDT, ORE, PP); + FusionCandidate CurrCand(L, DT, &PDT, ORE, PP); if (!CurrCand.isEligibleForFusion(SE)) continue; @@ -991,7 +990,7 @@ private: FuseCounter); FusionCandidate FusedCand( - performFusion((Peel ? FC0Copy : *FC0), *FC1), &DT, &PDT, ORE, + performFusion((Peel ? FC0Copy : *FC0), *FC1), DT, &PDT, ORE, FC0Copy.PP); FusedCand.verify(); assert(FusedCand.isEligibleForFusion(SE) && |