Skip to content

Commit 5a91ecf

Browse files
committed
CodePreparation needs unlisted passes invalidated
1 parent a33d1b0 commit 5a91ecf

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

polly/include/polly/CodePreparation.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ struct CodePreparationPass final : llvm::PassInfoMixin<CodePreparationPass> {
2626
llvm::PreservedAnalyses run(llvm::Function &F,
2727
llvm::FunctionAnalysisManager &FAM);
2828
};
29-
30-
bool runCodePreparation(llvm::Function &F, llvm::DominatorTree *DT,
31-
llvm::LoopInfo *LI, llvm::RegionInfo *RI);
3229
} // namespace polly
3330

3431
#endif /* POLLY_CODEPREPARATION_H */

polly/lib/Pass/PhaseManager.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,14 @@ class PhaseManager {
7373
bool ModifiedIR = false;
7474

7575
// Phase: prepare
76-
// TODO: Setting ModifiedIR will invalidate any anlysis, even if DT, LI are
76+
// TODO: Setting ModifiedIR will invalidate any analysis, even if DT, LI are
7777
// preserved.
78-
if (Opts.isPhaseEnabled(PassPhase::Prepare))
79-
ModifiedIR |= runCodePreparation(F, &DT, &LI, nullptr);
78+
if (Opts.isPhaseEnabled(PassPhase::Prepare)) {
79+
PreservedAnalyses PA = CodePreparationPass().run(F, FAM);
80+
FAM.invalidate(F, PA);
81+
if (!PA.areAllPreserved())
82+
ModifiedIR = true;
83+
}
8084

8185
// Can't do anything without detection
8286
if (!Opts.isPhaseEnabled(PassPhase::Detection))

polly/lib/Transform/CodePreparation.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,3 @@ PreservedAnalyses CodePreparationPass::run(Function &F,
5858
PA.preserve<LoopAnalysis>();
5959
return PA;
6060
}
61-
62-
bool polly::runCodePreparation(Function &F, DominatorTree *DT, LoopInfo *LI,
63-
RegionInfo *RI) {
64-
return runCodePreprationImpl(F, DT, LI, RI);
65-
}

0 commit comments

Comments
 (0)