Skip to content

Commit d8a2ea9

Browse files
committed
[LoopExtractor] Fix legacy pass dependencies
Fixes a memory leak of allocating `LoopInfoWrapperPass` and `DominatorTreeWrapperPass`.
1 parent 687bbf8 commit d8a2ea9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/IPO/LoopExtractor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ namespace {
5656

5757
void getAnalysisUsage(AnalysisUsage &AU) const override {
5858
AU.addRequiredID(BreakCriticalEdgesID);
59-
AU.addRequiredID(LoopSimplifyID);
6059
AU.addRequired<DominatorTreeWrapperPass>();
6160
AU.addRequired<LoopInfoWrapperPass>();
6261
AU.addPreserved<LoopInfoWrapperPass>();
62+
AU.addRequiredID(LoopSimplifyID);
6363
AU.addUsedIfAvailable<AssumptionCacheTracker>();
6464
}
6565
};
@@ -69,9 +69,9 @@ char LoopExtractor::ID = 0;
6969
INITIALIZE_PASS_BEGIN(LoopExtractor, "loop-extract",
7070
"Extract loops into new functions", false, false)
7171
INITIALIZE_PASS_DEPENDENCY(BreakCriticalEdges)
72-
INITIALIZE_PASS_DEPENDENCY(LoopSimplify)
7372
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
7473
INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
74+
INITIALIZE_PASS_DEPENDENCY(LoopSimplify)
7575
INITIALIZE_PASS_END(LoopExtractor, "loop-extract",
7676
"Extract loops into new functions", false, false)
7777

0 commit comments

Comments
 (0)