Skip to content

[Polly] Remove ScopPass infrastructure #125783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: users/meinersbur/polly_PhaseManager
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions polly/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ In Polly |version| the following important changes have been incorporated.

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

* The infrastructure around ScopPasses has been removed.
13 changes: 6 additions & 7 deletions polly/include/polly/CodeGen/CodeGeneration.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
#define POLLY_CODEGENERATION_H

#include "polly/CodeGen/IRBuilder.h"
#include "polly/ScopPass.h"
#include "llvm/IR/PassManager.h"

namespace llvm {
class RegionInfo;
}

namespace polly {
class IslAstInfo;

using llvm::BasicBlock;

enum VectorizerChoice {
VECTORIZER_NONE,
VECTORIZER_STRIPMINE,
Expand All @@ -28,11 +32,6 @@ extern VectorizerChoice PollyVectorizerChoice;
/// UnreachableInst.
void markBlockUnreachable(BasicBlock &Block, PollyIRBuilder &Builder);

struct CodeGenerationPass final : PassInfoMixin<CodeGenerationPass> {
PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &AR, SPMUpdater &U);
};

extern bool PerfMonitoring;

bool runCodeGeneration(Scop &S, llvm::RegionInfo &RI, IslAstInfo &AI);
Expand Down
21 changes: 1 addition & 20 deletions polly/include/polly/CodeGen/IslAst.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
#define POLLY_ISLAST_H

#include "polly/DependenceInfo.h"
#include "polly/ScopPass.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/IR/PassManager.h"
#include "isl/ctx.h"

namespace polly {
using llvm::raw_ostream;
using llvm::SmallPtrSet;

class Dependences;
Expand Down Expand Up @@ -164,24 +163,6 @@ class IslAstInfo {
///}
};

struct IslAstAnalysis : AnalysisInfoMixin<IslAstAnalysis> {
static AnalysisKey Key;

using Result = IslAstInfo;

IslAstInfo run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR);
};

struct IslAstPrinterPass final : PassInfoMixin<IslAstPrinterPass> {
IslAstPrinterPass(raw_ostream &OS) : OS(OS) {}

PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &, SPMUpdater &U);

raw_ostream &OS;
};

std::unique_ptr<IslAstInfo> runIslAstGen(Scop &S,
DependenceAnalysis::Result &DA);
} // namespace polly
Expand Down
7 changes: 1 addition & 6 deletions polly/include/polly/CodePreparation.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,14 @@
#ifndef POLLY_CODEPREPARATION_H
#define POLLY_CODEPREPARATION_H

#include "llvm/IR/PassManager.h"

namespace llvm {
class DominatorTree;
class Function;
class LoopInfo;
class RegionInfo;
} // namespace llvm

namespace polly {
struct CodePreparationPass final : llvm::PassInfoMixin<CodePreparationPass> {
llvm::PreservedAnalyses run(llvm::Function &F,
llvm::FunctionAnalysisManager &FAM);
};

bool runCodePreparation(llvm::Function &F, llvm::DominatorTree *DT,
llvm::LoopInfo *LI, llvm::RegionInfo *RI);
Expand Down
19 changes: 1 addition & 18 deletions polly/include/polly/DeLICM.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,14 @@
#ifndef POLLY_DELICM_H
#define POLLY_DELICM_H

#include "polly/ScopPass.h"
#include "isl/isl-noexceptions.h"

namespace llvm {
class raw_ostream;
} // namespace llvm

namespace polly {

struct DeLICMPass final : llvm::PassInfoMixin<DeLICMPass> {
DeLICMPass() {}

llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR, SPMUpdater &U);
};

struct DeLICMPrinterPass final : llvm::PassInfoMixin<DeLICMPrinterPass> {
DeLICMPrinterPass(raw_ostream &OS) : OS(OS) {}

PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
ScopStandardAnalysisResults &SAR, SPMUpdater &);

private:
llvm::raw_ostream &OS;
};
class Scop;

/// Determine whether two lifetimes are conflicting.
///
Expand Down
8 changes: 0 additions & 8 deletions polly/include/polly/DeadCodeElimination.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,9 @@
#define POLLY_DEADCODEELIMINATION_H

#include "polly/DependenceInfo.h"
#include "polly/ScopPass.h"

namespace polly {

struct DeadCodeElimPass final : llvm::PassInfoMixin<DeadCodeElimPass> {
DeadCodeElimPass() {}

llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR, SPMUpdater &U);
};

bool runDeadCodeElim(Scop &S, DependenceAnalysis::Result &DA);
} // namespace polly

Expand Down
26 changes: 11 additions & 15 deletions polly/include/polly/DependenceInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@
#ifndef POLLY_DEPENDENCE_INFO_H
#define POLLY_DEPENDENCE_INFO_H

#include "polly/ScopPass.h"
#include "llvm/ADT/DenseMap.h"
#include "isl/ctx.h"
#include "isl/isl-noexceptions.h"

namespace llvm {
class raw_ostream;
}

namespace polly {
class MemoryAccess;
class Scop;
class ScopStmt;

using llvm::DenseMap;

/// The accumulated dependence information for a SCoP.
///
Expand Down Expand Up @@ -193,8 +202,7 @@ class Dependences final {

extern Dependences::AnalysisLevel OptAnalysisLevel;

struct DependenceAnalysis final : public AnalysisInfoMixin<DependenceAnalysis> {
static AnalysisKey Key;
struct DependenceAnalysis final {
struct Result {
Scop &S;
std::unique_ptr<Dependences> D[Dependences::NumAnalysisLevels];
Expand All @@ -219,18 +227,6 @@ struct DependenceAnalysis final : public AnalysisInfoMixin<DependenceAnalysis> {
/// dependencies.
void abandonDependences();
};
Result run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR);
};

struct DependenceInfoPrinterPass final
: PassInfoMixin<DependenceInfoPrinterPass> {
DependenceInfoPrinterPass(raw_ostream &OS) : OS(OS) {}

PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
ScopStandardAnalysisResults &, SPMUpdater &);

raw_ostream &OS;
};

DependenceAnalysis::Result runDependenceAnalysis(Scop &S);
Expand Down
21 changes: 1 addition & 20 deletions polly/include/polly/ForwardOpTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,8 @@
#ifndef POLLY_FORWARDOPTREE_H
#define POLLY_FORWARDOPTREE_H

#include "polly/ScopPass.h"

namespace polly {

struct ForwardOpTreePass final : llvm::PassInfoMixin<ForwardOpTreePass> {
ForwardOpTreePass() {}

llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR, SPMUpdater &U);
};

struct ForwardOpTreePrinterPass final
: llvm::PassInfoMixin<ForwardOpTreePrinterPass> {
ForwardOpTreePrinterPass(raw_ostream &OS) : OS(OS) {}

PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
ScopStandardAnalysisResults &SAR, SPMUpdater &);

private:
llvm::raw_ostream &OS;
};
class Scop;

/// Pass that redirects scalar reads to array elements that are known to contain
/// the same value.
Expand Down
17 changes: 3 additions & 14 deletions polly/include/polly/JSONExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,15 @@
#define POLLY_JSONEXPORTER_H

#include "polly/DependenceInfo.h"
#include "polly/ScopPass.h"
#include "llvm/IR/PassManager.h"

namespace polly {

/// This pass exports a scop to a jscop file. The filename is generated from the
/// concatenation of the function and scop name.
struct JSONExportPass final : llvm::PassInfoMixin<JSONExportPass> {
llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
ScopStandardAnalysisResults &, SPMUpdater &);
};

/// This pass imports a scop from a jscop file. The filename is deduced from the
/// concatenation of the function and scop name.
struct JSONImportPass final : llvm::PassInfoMixin<JSONExportPass> {
llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
ScopStandardAnalysisResults &, SPMUpdater &);
};

void runImportJSON(Scop &S, DependenceAnalysis::Result &DA);

/// This pass exports a scop to a jscop file. The filename is generated from the
/// concatenation of the function and scop name.
void runExportJSON(Scop &S);
} // namespace polly

Expand Down
20 changes: 0 additions & 20 deletions polly/include/polly/MaximalStaticExpansion.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,9 @@
#define POLLY_MAXIMALSTATICEXPANSION_H

#include "polly/DependenceInfo.h"
#include "polly/ScopPass.h"
#include "llvm/IR/PassManager.h"

namespace polly {

class MaximalStaticExpansionPass
: public llvm::PassInfoMixin<MaximalStaticExpansionPass> {
public:
llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
ScopStandardAnalysisResults &, SPMUpdater &);
};

struct MaximalStaticExpansionPrinterPass
: llvm::PassInfoMixin<MaximalStaticExpansionPrinterPass> {
MaximalStaticExpansionPrinterPass(raw_ostream &OS) : OS(OS) {}

PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
ScopStandardAnalysisResults &SAR, SPMUpdater &);

private:
llvm::raw_ostream &OS;
};

void runMaximalStaticExpansion(Scop &S, DependenceAnalysis::Result &DI);
} // namespace polly

Expand Down
6 changes: 4 additions & 2 deletions polly/include/polly/Pass/PhaseManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@

#include "polly/DependenceInfo.h"
#include "llvm/ADT/Bitset.h"
#include "llvm/IR/PassManager.h"
#include <stddef.h>

namespace llvm {
class Function;
class Error;
template <typename EnumT> struct enum_iteration_traits;
} // namespace llvm

namespace polly {
using llvm::Function;
using llvm::StringRef;

/// Phases (in execution order) within the Polly pass.
enum class PassPhase {
Expand Down
11 changes: 1 addition & 10 deletions polly/include/polly/PruneUnprofitable.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,8 @@
#ifndef POLLY_PRUNEUNPROFITABLE_H
#define POLLY_PRUNEUNPROFITABLE_H

#include "polly/ScopPass.h"

namespace polly {

struct PruneUnprofitablePass final
: llvm::PassInfoMixin<PruneUnprofitablePass> {
PruneUnprofitablePass() {}

llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR, SPMUpdater &U);
};
class Scop;

bool runPruneUnprofitable(Scop &S);
} // namespace polly
Expand Down
24 changes: 4 additions & 20 deletions polly/include/polly/ScheduleOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,12 @@
#define POLLY_SCHEDULEOPTIMIZER_H

#include "polly/DependenceInfo.h"
#include "polly/ScopPass.h"

namespace polly {

struct IslScheduleOptimizerPass final
: llvm::PassInfoMixin<IslScheduleOptimizerPass> {
IslScheduleOptimizerPass() {}

llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR, SPMUpdater &U);
};
namespace llvm {
class TargetTransformInfo;
}

struct IslScheduleOptimizerPrinterPass final
: llvm::PassInfoMixin<IslScheduleOptimizerPrinterPass> {
IslScheduleOptimizerPrinterPass(raw_ostream &OS) : OS(OS) {}

PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
ScopStandardAnalysisResults &SAR, SPMUpdater &);

private:
llvm::raw_ostream &OS;
};
namespace polly {

void runIslScheduleOptimizer(Scop &S, llvm::TargetTransformInfo *TTI,
DependenceAnalysis::Result &Deps);
Expand Down
1 change: 0 additions & 1 deletion polly/include/polly/ScopGraphPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "llvm/Analysis/RegionInfo.h"
#include "llvm/Analysis/RegionIterator.h"
#include "llvm/Analysis/RegionPrinter.h"
#include "llvm/IR/PassManager.h"

namespace llvm {

Expand Down
1 change: 0 additions & 1 deletion polly/include/polly/ScopInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/ValueHandle.h"
#include "isl/isl-noexceptions.h"
#include <cassert>
Expand Down
Loading