summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopDetection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index 27dfc930db8..199306abc53 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -284,8 +284,8 @@ static bool IsFnNameListedInOnlyFunctions(StringRef FnName) {
ScopDetection::ScopDetection(Function &F, const DominatorTree &DT,
ScalarEvolution &SE, LoopInfo &LI, RegionInfo &RI,
- AliasAnalysis &AA)
- : DT(DT), SE(SE), LI(LI), RI(RI), AA(AA) {
+ AliasAnalysis &AA, OptimizationRemarkEmitter &ORE)
+ : DT(DT), SE(SE), LI(LI), RI(RI), AA(AA), ORE(ORE) {
if (!PollyProcessUnprofitable && LI.empty())
return;
@@ -1579,7 +1579,7 @@ void ScopDetection::emitMissedRemarks(const Function &F) {
for (auto &DIt : DetectionContextMap) {
auto &DC = DIt.getSecond();
if (DC.Log.hasErrors())
- emitRejectionRemarks(DIt.getFirst(), DC.Log);
+ emitRejectionRemarks(DIt.getFirst(), DC.Log, ORE);
}
}
@@ -1728,7 +1728,8 @@ bool ScopDetectionWrapperPass::runOnFunction(llvm::Function &F) {
auto &AA = getAnalysis<AAResultsWrapperPass>().getAAResults();
auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE();
auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- Result.reset(new ScopDetection(F, DT, SE, LI, RI, AA));
+ auto &ORE = getAnalysis<OptimizationRemarkEmitterWrapperPass>().getORE();
+ Result.reset(new ScopDetection(F, DT, SE, LI, RI, AA, ORE));
return false;
}
@@ -1736,6 +1737,7 @@ void ScopDetectionWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<LoopInfoWrapperPass>();
AU.addRequiredTransitive<ScalarEvolutionWrapperPass>();
AU.addRequired<DominatorTreeWrapperPass>();
+ AU.addRequired<OptimizationRemarkEmitterWrapperPass>();
// We also need AA and RegionInfo when we are verifying analysis.
AU.addRequiredTransitive<AAResultsWrapperPass>();
AU.addRequiredTransitive<RegionInfoPass>();
@@ -1767,7 +1769,8 @@ ScopDetection ScopAnalysis::run(Function &F, FunctionAnalysisManager &FAM) {
auto &AA = FAM.getResult<AAManager>(F);
auto &SE = FAM.getResult<ScalarEvolutionAnalysis>(F);
auto &DT = FAM.getResult<DominatorTreeAnalysis>(F);
- return {F, DT, SE, LI, RI, AA};
+ auto &ORE = FAM.getResult<OptimizationRemarkEmitterAnalysis>(F);
+ return {F, DT, SE, LI, RI, AA, ORE};
}
PreservedAnalyses ScopAnalysisPrinterPass::run(Function &F,
@@ -1792,5 +1795,6 @@ INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass);
INITIALIZE_PASS_DEPENDENCY(RegionInfoPass);
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass);
INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass);
+INITIALIZE_PASS_DEPENDENCY(OptimizationRemarkEmitterWrapperPass);
INITIALIZE_PASS_END(ScopDetectionWrapperPass, "polly-detect",
"Polly - Detect static control parts (SCoPs)", false, false)
OpenPOWER on IntegriCloud