15#include "llvm/Analysis/BasicAliasAnalysis.h"
16#include "llvm/Analysis/GlobalsModRef.h"
17#include "llvm/Analysis/LazyBlockFrequencyInfo.h"
18#include "llvm/Analysis/LazyBranchProbabilityInfo.h"
19#include "llvm/Analysis/OptimizationRemarkEmitter.h"
20#include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"
21#include "llvm/Analysis/TargetTransformInfo.h"
33 if ((
S = getAnalysis<ScopInfoRegionPass>().getScop()))
47 AU.addPreserved<AAResultsWrapperPass>();
48 AU.addPreserved<BasicAAWrapperPass>();
49 AU.addPreserved<LoopInfoWrapperPass>();
50 AU.addPreserved<DominatorTreeWrapperPass>();
51 AU.addPreserved<GlobalsAAWrapperPass>();
53 AU.addPreserved<ScalarEvolutionWrapperPass>();
54 AU.addPreserved<SCEVAAWrapperPass>();
55 AU.addPreserved<OptimizationRemarkEmitterWrapperPass>();
56 AU.addPreserved<LazyBlockFrequencyInfoPass>();
57 AU.addPreserved<LazyBranchProbabilityInfoPass>();
58 AU.addPreserved<RegionInfoPass>();
60 AU.addPreserved<TargetTransformInfoWrapperPass>();
71template class InnerAnalysisManagerProxy<ScopAnalysisManager, Function>;
72template class OuterAnalysisManagerProxy<FunctionAnalysisManager,
Scop,
80 auto PA = PreservedAnalyses::all();
81 for (
auto &Pass : Passes) {
82 auto PassPA = Pass->run(
S, AM, AR, U);
84 AM.invalidate(
S, PassPA);
85 PA.intersect(std::move(PassPA));
91 PA.preserveSet<AllAnalysesOn<Scop>>();
95bool ScopAnalysisManagerFunctionProxy::Result::invalidate(
96 Function &F,
const PreservedAnalyses &PA,
97 FunctionAnalysisManager::Invalidator &Inv) {
101 if (!(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Function>>()) ||
103 Inv.invalidate<ScalarEvolutionAnalysis>(F, PA) ||
104 Inv.invalidate<LoopAnalysis>(F, PA) ||
105 Inv.invalidate<DominatorTreeAnalysis>(F, PA)) {
109 if (
auto *
scop =
S.second.get())
111 InnerAM->clear(*
scop,
scop->getName());
117 bool allPreserved = PA.allAnalysesInSetPreserved<AllAnalysesOn<Scop>>();
122 for (
auto &
S : *SI) {
123 std::optional<PreservedAnalyses> InnerPA;
124 auto *
scop =
S.second.get();
128 if (
auto *OuterProxy =
130 for (
const auto &InvPair : OuterProxy->getOuterInvalidations()) {
131 auto *OuterAnalysisID = InvPair.first;
132 const auto &InnerAnalysisIDs = InvPair.second;
134 if (Inv.invalidate(OuterAnalysisID, F, PA)) {
137 for (
auto *InnerAnalysisID : InnerAnalysisIDs)
138 InnerPA->abandon(InnerAnalysisID);
143 InnerAM->invalidate(*
scop, *InnerPA);
149 InnerAM->invalidate(*
scop, PA);
156ScopAnalysisManagerFunctionProxy::Result
157ScopAnalysisManagerFunctionProxy::run(Function &F,
158 FunctionAnalysisManager &FAM) {
167 FunctionAnalysisManager &FAM) {
static RegisterPass< ScopPrinterWrapperPass > M("dot-scops", "Polly - Print Scops of function")
polly scop functions based on how much of the function is a scop
typename InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Result Result
Result run(IRUnitT &IR, AnalysisManager< IRUnitT, ExtraArgTs... > &AM, ExtraArgTs...)
The legacy pass manager's analysis pass to compute scop information for a region.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
void print(raw_ostream &OS, const Module *) const override
bool runOnRegion(Region *R, RGPassManager &RGM) override
virtual bool runOnScop(Scop &S)=0
runOnScop - This method must be overloaded to perform the desired Polyhedral transformation or analys...
virtual void printScop(raw_ostream &OS, Scop &S) const
Print method for SCoPs.
This file contains the declaration of the PolyhedralInfo class, which will provide an interface to ex...
InnerAnalysisManagerProxy< ScopAnalysisManager, Function > ScopAnalysisManagerFunctionProxy
AnalysisManager< Scop, ScopStandardAnalysisResults & > ScopAnalysisManager
OuterAnalysisManagerProxy< FunctionAnalysisManager, Scop, ScopStandardAnalysisResults & > FunctionAnalysisManagerScopProxy