Skip to content

Commit 324e92b

Browse files
committed
[Polly] Remove ScopPass infrastructure
1 parent 7a0f7db commit 324e92b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+53
-1161
lines changed

polly/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ In Polly |version| the following important changes have been incorporated.
1717

1818
* Polly's support for the legacy pass manager has been removed.
1919

20+
* The infrastructure around ScopPasses has been removed.

polly/include/polly/CodeGen/CodeGeneration.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010
#define POLLY_CODEGENERATION_H
1111

1212
#include "polly/CodeGen/IRBuilder.h"
13-
#include "polly/ScopPass.h"
14-
#include "llvm/IR/PassManager.h"
13+
14+
namespace llvm {
15+
class RegionInfo;
16+
}
1517

1618
namespace polly {
1719
class IslAstInfo;
1820

21+
using llvm::BasicBlock;
22+
1923
enum VectorizerChoice {
2024
VECTORIZER_NONE,
2125
VECTORIZER_STRIPMINE,
@@ -28,11 +32,6 @@ extern VectorizerChoice PollyVectorizerChoice;
2832
/// UnreachableInst.
2933
void markBlockUnreachable(BasicBlock &Block, PollyIRBuilder &Builder);
3034

31-
struct CodeGenerationPass final : PassInfoMixin<CodeGenerationPass> {
32-
PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
33-
ScopStandardAnalysisResults &AR, SPMUpdater &U);
34-
};
35-
3635
extern bool PerfMonitoring;
3736

3837
bool runCodeGeneration(Scop &S, llvm::RegionInfo &RI, IslAstInfo &AI);

polly/include/polly/CodeGen/IslAst.h

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
#define POLLY_ISLAST_H
2323

2424
#include "polly/DependenceInfo.h"
25-
#include "polly/ScopPass.h"
2625
#include "llvm/ADT/SmallPtrSet.h"
27-
#include "llvm/IR/PassManager.h"
2826
#include "isl/ctx.h"
2927

3028
namespace polly {
29+
using llvm::raw_ostream;
3130
using llvm::SmallPtrSet;
3231

3332
class Dependences;
@@ -164,24 +163,6 @@ class IslAstInfo {
164163
///}
165164
};
166165

167-
struct IslAstAnalysis : AnalysisInfoMixin<IslAstAnalysis> {
168-
static AnalysisKey Key;
169-
170-
using Result = IslAstInfo;
171-
172-
IslAstInfo run(Scop &S, ScopAnalysisManager &SAM,
173-
ScopStandardAnalysisResults &SAR);
174-
};
175-
176-
struct IslAstPrinterPass final : PassInfoMixin<IslAstPrinterPass> {
177-
IslAstPrinterPass(raw_ostream &OS) : OS(OS) {}
178-
179-
PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
180-
ScopStandardAnalysisResults &, SPMUpdater &U);
181-
182-
raw_ostream &OS;
183-
};
184-
185166
std::unique_ptr<IslAstInfo> runIslAstGen(Scop &S,
186167
DependenceAnalysis::Result &DA);
187168
} // namespace polly

polly/include/polly/CodePreparation.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@
1313
#ifndef POLLY_CODEPREPARATION_H
1414
#define POLLY_CODEPREPARATION_H
1515

16-
#include "llvm/IR/PassManager.h"
17-
1816
namespace llvm {
1917
class DominatorTree;
18+
class Function;
2019
class LoopInfo;
2120
class RegionInfo;
2221
} // namespace llvm
2322

2423
namespace polly {
25-
struct CodePreparationPass final : llvm::PassInfoMixin<CodePreparationPass> {
26-
llvm::PreservedAnalyses run(llvm::Function &F,
27-
llvm::FunctionAnalysisManager &FAM);
28-
};
24+
bool runCodePreparation(llvm::Function &F, llvm::DominatorTree *DT,
25+
llvm::LoopInfo *LI, llvm::RegionInfo *RI);
2926
} // namespace polly
3027

3128
#endif /* POLLY_CODEPREPARATION_H */

polly/include/polly/DeLICM.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,14 @@
1717
#ifndef POLLY_DELICM_H
1818
#define POLLY_DELICM_H
1919

20-
#include "polly/ScopPass.h"
2120
#include "isl/isl-noexceptions.h"
2221

2322
namespace llvm {
2423
class raw_ostream;
2524
} // namespace llvm
2625

2726
namespace polly {
28-
29-
struct DeLICMPass final : llvm::PassInfoMixin<DeLICMPass> {
30-
DeLICMPass() {}
31-
32-
llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
33-
ScopStandardAnalysisResults &SAR, SPMUpdater &U);
34-
};
35-
36-
struct DeLICMPrinterPass final : llvm::PassInfoMixin<DeLICMPrinterPass> {
37-
DeLICMPrinterPass(raw_ostream &OS) : OS(OS) {}
38-
39-
PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
40-
ScopStandardAnalysisResults &SAR, SPMUpdater &);
41-
42-
private:
43-
llvm::raw_ostream &OS;
44-
};
27+
class Scop;
4528

4629
/// Determine whether two lifetimes are conflicting.
4730
///

polly/include/polly/DeadCodeElimination.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,9 @@
1414
#define POLLY_DEADCODEELIMINATION_H
1515

1616
#include "polly/DependenceInfo.h"
17-
#include "polly/ScopPass.h"
1817

1918
namespace polly {
2019

21-
struct DeadCodeElimPass final : llvm::PassInfoMixin<DeadCodeElimPass> {
22-
DeadCodeElimPass() {}
23-
24-
llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
25-
ScopStandardAnalysisResults &SAR, SPMUpdater &U);
26-
};
27-
2820
bool runDeadCodeElim(Scop &S, DependenceAnalysis::Result &DA);
2921
} // namespace polly
3022

polly/include/polly/DependenceInfo.h

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,20 @@
2222
#ifndef POLLY_DEPENDENCE_INFO_H
2323
#define POLLY_DEPENDENCE_INFO_H
2424

25-
#include "polly/ScopPass.h"
25+
#include "llvm/ADT/DenseMap.h"
2626
#include "isl/ctx.h"
2727
#include "isl/isl-noexceptions.h"
2828

29+
namespace llvm {
30+
class raw_ostream;
31+
}
32+
2933
namespace polly {
34+
class MemoryAccess;
35+
class Scop;
36+
class ScopStmt;
37+
38+
using llvm::DenseMap;
3039

3140
/// The accumulated dependence information for a SCoP.
3241
///
@@ -193,8 +202,7 @@ class Dependences final {
193202

194203
extern Dependences::AnalysisLevel OptAnalysisLevel;
195204

196-
struct DependenceAnalysis final : public AnalysisInfoMixin<DependenceAnalysis> {
197-
static AnalysisKey Key;
205+
struct DependenceAnalysis final {
198206
struct Result {
199207
Scop &S;
200208
std::unique_ptr<Dependences> D[Dependences::NumAnalysisLevels];
@@ -219,18 +227,6 @@ struct DependenceAnalysis final : public AnalysisInfoMixin<DependenceAnalysis> {
219227
/// dependencies.
220228
void abandonDependences();
221229
};
222-
Result run(Scop &S, ScopAnalysisManager &SAM,
223-
ScopStandardAnalysisResults &SAR);
224-
};
225-
226-
struct DependenceInfoPrinterPass final
227-
: PassInfoMixin<DependenceInfoPrinterPass> {
228-
DependenceInfoPrinterPass(raw_ostream &OS) : OS(OS) {}
229-
230-
PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
231-
ScopStandardAnalysisResults &, SPMUpdater &);
232-
233-
raw_ostream &OS;
234230
};
235231

236232
DependenceAnalysis::Result runDependenceAnalysis(Scop &S);

polly/include/polly/ForwardOpTree.h

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,8 @@
1313
#ifndef POLLY_FORWARDOPTREE_H
1414
#define POLLY_FORWARDOPTREE_H
1515

16-
#include "polly/ScopPass.h"
17-
1816
namespace polly {
19-
20-
struct ForwardOpTreePass final : llvm::PassInfoMixin<ForwardOpTreePass> {
21-
ForwardOpTreePass() {}
22-
23-
llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
24-
ScopStandardAnalysisResults &SAR, SPMUpdater &U);
25-
};
26-
27-
struct ForwardOpTreePrinterPass final
28-
: llvm::PassInfoMixin<ForwardOpTreePrinterPass> {
29-
ForwardOpTreePrinterPass(raw_ostream &OS) : OS(OS) {}
30-
31-
PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
32-
ScopStandardAnalysisResults &SAR, SPMUpdater &);
33-
34-
private:
35-
llvm::raw_ostream &OS;
36-
};
17+
class Scop;
3718

3819
/// Pass that redirects scalar reads to array elements that are known to contain
3920
/// the same value.

polly/include/polly/JSONExporter.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,15 @@
1010
#define POLLY_JSONEXPORTER_H
1111

1212
#include "polly/DependenceInfo.h"
13-
#include "polly/ScopPass.h"
14-
#include "llvm/IR/PassManager.h"
1513

1614
namespace polly {
1715

18-
/// This pass exports a scop to a jscop file. The filename is generated from the
19-
/// concatenation of the function and scop name.
20-
struct JSONExportPass final : llvm::PassInfoMixin<JSONExportPass> {
21-
llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
22-
ScopStandardAnalysisResults &, SPMUpdater &);
23-
};
24-
2516
/// This pass imports a scop from a jscop file. The filename is deduced from the
2617
/// concatenation of the function and scop name.
27-
struct JSONImportPass final : llvm::PassInfoMixin<JSONExportPass> {
28-
llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
29-
ScopStandardAnalysisResults &, SPMUpdater &);
30-
};
31-
3218
void runImportJSON(Scop &S, DependenceAnalysis::Result &DA);
19+
20+
/// This pass exports a scop to a jscop file. The filename is generated from the
21+
/// concatenation of the function and scop name.
3322
void runExportJSON(Scop &S);
3423
} // namespace polly
3524

polly/include/polly/MaximalStaticExpansion.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,9 @@
1515
#define POLLY_MAXIMALSTATICEXPANSION_H
1616

1717
#include "polly/DependenceInfo.h"
18-
#include "polly/ScopPass.h"
19-
#include "llvm/IR/PassManager.h"
2018

2119
namespace polly {
2220

23-
class MaximalStaticExpansionPass
24-
: public llvm::PassInfoMixin<MaximalStaticExpansionPass> {
25-
public:
26-
llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
27-
ScopStandardAnalysisResults &, SPMUpdater &);
28-
};
29-
30-
struct MaximalStaticExpansionPrinterPass
31-
: llvm::PassInfoMixin<MaximalStaticExpansionPrinterPass> {
32-
MaximalStaticExpansionPrinterPass(raw_ostream &OS) : OS(OS) {}
33-
34-
PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
35-
ScopStandardAnalysisResults &SAR, SPMUpdater &);
36-
37-
private:
38-
llvm::raw_ostream &OS;
39-
};
40-
4121
void runMaximalStaticExpansion(Scop &S, DependenceAnalysis::Result &DI);
4222
} // namespace polly
4323

0 commit comments

Comments
 (0)