[Polly] Mark classes as final by default. NFC.

This make is obivious that a class was not intended to be derived from.

NPM analysis pass can unfortunately not marked as final because they are
derived from a llvm::Checker<T> template internally by the NPM.

Also normalize the use of classes/structs
 * NPM passes are structs
 * Legacy passes are classes
 * structs that have methods and are not a visitor pattern are classes
 * structs have public inheritance by default, remove "public" keyword
 * Use typedef'ed type instead of inline forward declaration
This commit is contained in:
Michael Kruse 2022-05-17 10:55:27 -05:00
parent d92cec4c96
commit bd93df937a
66 changed files with 209 additions and 212 deletions

View File

@ -41,8 +41,8 @@ template <typename AnalysisT, bool IsSimple,
typename AnalysisGraphTraitsT = typename AnalysisGraphTraitsT =
DefaultAnalysisGraphTraits<typename AnalysisT::Result &, GraphT>> DefaultAnalysisGraphTraits<typename AnalysisT::Result &, GraphT>>
struct DOTGraphTraitsViewer struct DOTGraphTraitsViewer
: public PassInfoMixin<DOTGraphTraitsViewer<AnalysisT, IsSimple, GraphT, : PassInfoMixin<DOTGraphTraitsViewer<AnalysisT, IsSimple, GraphT,
AnalysisGraphTraitsT>> { AnalysisGraphTraitsT>> {
DOTGraphTraitsViewer(StringRef GraphName) : Name(GraphName) {} DOTGraphTraitsViewer(StringRef GraphName) : Name(GraphName) {}
virtual ~DOTGraphTraitsViewer() {} virtual ~DOTGraphTraitsViewer() {}
@ -96,8 +96,8 @@ template <typename AnalysisT, bool IsSimple,
typename AnalysisGraphTraitsT = typename AnalysisGraphTraitsT =
DefaultAnalysisGraphTraits<typename AnalysisT::Result &, GraphT>> DefaultAnalysisGraphTraits<typename AnalysisT::Result &, GraphT>>
struct DOTGraphTraitsPrinter struct DOTGraphTraitsPrinter
: public PassInfoMixin<DOTGraphTraitsPrinter<AnalysisT, IsSimple, GraphT, : PassInfoMixin<DOTGraphTraitsPrinter<AnalysisT, IsSimple, GraphT,
AnalysisGraphTraitsT>> { AnalysisGraphTraitsT>> {
DOTGraphTraitsPrinter(StringRef GraphName) : Name(GraphName) {} DOTGraphTraitsPrinter(StringRef GraphName) : Name(GraphName) {}
virtual ~DOTGraphTraitsPrinter() {} virtual ~DOTGraphTraitsPrinter() {}

View File

@ -625,7 +625,7 @@ protected:
/// Generate a new vector basic block for a polyhedral statement. /// Generate a new vector basic block for a polyhedral statement.
/// ///
/// The only public function exposed is generate(). /// The only public function exposed is generate().
class VectorBlockGenerator : BlockGenerator { class VectorBlockGenerator final : BlockGenerator {
public: public:
/// Generate a new vector basic block for a ScoPStmt. /// Generate a new vector basic block for a ScoPStmt.
/// ///
@ -803,7 +803,7 @@ private:
}; };
/// Generator for new versions of polyhedral region statements. /// Generator for new versions of polyhedral region statements.
class RegionGenerator : public BlockGenerator { class RegionGenerator final : BlockGenerator {
public: public:
/// Create a generator for regions. /// Create a generator for regions.
/// ///

View File

@ -28,7 +28,7 @@ extern VectorizerChoice PollyVectorizerChoice;
/// UnreachableInst. /// UnreachableInst.
void markBlockUnreachable(BasicBlock &Block, PollyIRBuilder &Builder); void markBlockUnreachable(BasicBlock &Block, PollyIRBuilder &Builder);
struct CodeGenerationPass : public PassInfoMixin<CodeGenerationPass> { struct CodeGenerationPass final : PassInfoMixin<CodeGenerationPass> {
PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM, PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &AR, SPMUpdater &U); ScopStandardAnalysisResults &AR, SPMUpdater &U);
}; };

View File

@ -120,7 +120,7 @@ private:
class IRInserter final : public llvm::IRBuilderDefaultInserter { class IRInserter final : public llvm::IRBuilderDefaultInserter {
public: public:
IRInserter() = default; IRInserter() = default;
IRInserter(class ScopAnnotator &A) : Annotator(&A) {} IRInserter(ScopAnnotator &A) : Annotator(&A) {}
void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name, void InsertHelper(llvm::Instruction *I, const llvm::Twine &Name,
llvm::BasicBlock *BB, llvm::BasicBlock *BB,
@ -131,7 +131,7 @@ public:
} }
private: private:
class ScopAnnotator *Annotator = nullptr; ScopAnnotator *Annotator = nullptr;
}; };
// TODO: We should not name instructions in NDEBUG builds. // TODO: We should not name instructions in NDEBUG builds.

View File

@ -29,9 +29,9 @@
namespace polly { namespace polly {
using llvm::SmallPtrSet; using llvm::SmallPtrSet;
struct Dependences; class Dependences;
class IslAst { class IslAst final {
public: public:
IslAst(const IslAst &) = delete; IslAst(const IslAst &) = delete;
IslAst &operator=(const IslAst &) = delete; IslAst &operator=(const IslAst &) = delete;
@ -163,7 +163,7 @@ public:
///} ///}
}; };
struct IslAstAnalysis : public AnalysisInfoMixin<IslAstAnalysis> { struct IslAstAnalysis : AnalysisInfoMixin<IslAstAnalysis> {
static AnalysisKey Key; static AnalysisKey Key;
using Result = IslAstInfo; using Result = IslAstInfo;
@ -172,7 +172,7 @@ struct IslAstAnalysis : public AnalysisInfoMixin<IslAstAnalysis> {
ScopStandardAnalysisResults &SAR); ScopStandardAnalysisResults &SAR);
}; };
class IslAstInfoWrapperPass : public ScopPass { class IslAstInfoWrapperPass final : public ScopPass {
std::unique_ptr<IslAstInfo> Ast; std::unique_ptr<IslAstInfo> Ast;
public: public:
@ -199,7 +199,7 @@ public:
llvm::Pass *createIslAstInfoWrapperPassPass(); llvm::Pass *createIslAstInfoWrapperPassPass();
llvm::Pass *createIslAstInfoPrinterLegacyPass(llvm::raw_ostream &OS); llvm::Pass *createIslAstInfoPrinterLegacyPass(llvm::raw_ostream &OS);
struct IslAstPrinterPass : public PassInfoMixin<IslAstPrinterPass> { struct IslAstPrinterPass final : PassInfoMixin<IslAstPrinterPass> {
IslAstPrinterPass(raw_ostream &OS) : OS(OS) {} IslAstPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM, PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,

View File

@ -78,7 +78,7 @@ class ScopArrayInfo;
/// to use this information in our IslAstGenerator. Preliminary patches are /// to use this information in our IslAstGenerator. Preliminary patches are
/// available, but have not been committed yet. /// available, but have not been committed yet.
/// ///
class IslExprBuilder { class IslExprBuilder final {
public: public:
/// A map from isl_ids to llvm::Values. /// A map from isl_ids to llvm::Values.
typedef llvm::MapVector<isl_id *, llvm::AssertingVH<llvm::Value>> IDToValueTy; typedef llvm::MapVector<isl_id *, llvm::AssertingVH<llvm::Value>> IDToValueTy;

View File

@ -22,7 +22,7 @@ namespace polly {
/// This ParallelLoopGenerator subclass handles the generation of parallelized /// This ParallelLoopGenerator subclass handles the generation of parallelized
/// code, utilizing the GNU OpenMP library. /// code, utilizing the GNU OpenMP library.
class ParallelLoopGeneratorGOMP : public ParallelLoopGenerator { class ParallelLoopGeneratorGOMP final : public ParallelLoopGenerator {
public: public:
/// Create a parallel loop generator for the current function. /// Create a parallel loop generator for the current function.
ParallelLoopGeneratorGOMP(PollyIRBuilder &Builder, LoopInfo &LI, ParallelLoopGeneratorGOMP(PollyIRBuilder &Builder, LoopInfo &LI,

View File

@ -24,7 +24,7 @@ using llvm::GlobalVariable;
/// This ParallelLoopGenerator subclass handles the generation of parallelized /// This ParallelLoopGenerator subclass handles the generation of parallelized
/// code, utilizing the LLVM OpenMP library. /// code, utilizing the LLVM OpenMP library.
class ParallelLoopGeneratorKMP : public ParallelLoopGenerator { class ParallelLoopGeneratorKMP final : public ParallelLoopGenerator {
public: public:
/// Create a parallel loop generator for the current function. /// Create a parallel loop generator for the current function.
ParallelLoopGeneratorKMP(PollyIRBuilder &Builder, LoopInfo &LI, ParallelLoopGeneratorKMP(PollyIRBuilder &Builder, LoopInfo &LI,

View File

@ -13,7 +13,7 @@
namespace polly { namespace polly {
class PerfMonitor { class PerfMonitor final {
public: public:
/// Create a new performance monitor. /// Create a new performance monitor.
/// ///

View File

@ -16,7 +16,7 @@
#include "llvm/IR/PassManager.h" #include "llvm/IR/PassManager.h"
namespace polly { namespace polly {
struct CodePreparationPass : public llvm::PassInfoMixin<CodePreparationPass> { struct CodePreparationPass final : llvm::PassInfoMixin<CodePreparationPass> {
llvm::PreservedAnalyses run(llvm::Function &F, llvm::PreservedAnalyses run(llvm::Function &F,
llvm::FunctionAnalysisManager &FAM); llvm::FunctionAnalysisManager &FAM);
}; };

View File

@ -31,14 +31,14 @@ namespace polly {
llvm::Pass *createDeLICMWrapperPass(); llvm::Pass *createDeLICMWrapperPass();
llvm::Pass *createDeLICMPrinterLegacyPass(llvm::raw_ostream &OS); llvm::Pass *createDeLICMPrinterLegacyPass(llvm::raw_ostream &OS);
struct DeLICMPass : llvm::PassInfoMixin<DeLICMPass> { struct DeLICMPass final : llvm::PassInfoMixin<DeLICMPass> {
DeLICMPass() {} DeLICMPass() {}
llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM, llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR, SPMUpdater &U); ScopStandardAnalysisResults &SAR, SPMUpdater &U);
}; };
struct DeLICMPrinterPass : llvm::PassInfoMixin<DeLICMPrinterPass> { struct DeLICMPrinterPass final : llvm::PassInfoMixin<DeLICMPrinterPass> {
DeLICMPrinterPass(raw_ostream &OS) : OS(OS) {} DeLICMPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Scop &S, ScopAnalysisManager &, PreservedAnalyses run(Scop &S, ScopAnalysisManager &,

View File

@ -24,7 +24,7 @@ class raw_ostream;
namespace polly { namespace polly {
llvm::Pass *createDeadCodeElimWrapperPass(); llvm::Pass *createDeadCodeElimWrapperPass();
struct DeadCodeElimPass : llvm::PassInfoMixin<DeadCodeElimPass> { struct DeadCodeElimPass final : llvm::PassInfoMixin<DeadCodeElimPass> {
DeadCodeElimPass() {} DeadCodeElimPass() {}
llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM, llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,

View File

@ -33,7 +33,8 @@ namespace polly {
/// The Dependences struct holds all dependence information we collect and /// The Dependences struct holds all dependence information we collect and
/// compute for one SCoP. It also offers an interface that allows users to /// compute for one SCoP. It also offers an interface that allows users to
/// query only specific parts. /// query only specific parts.
struct Dependences { class Dependences final {
public:
// Granularities of the current dependence analysis // Granularities of the current dependence analysis
enum AnalysisLevel { enum AnalysisLevel {
AL_Statement = 0, AL_Statement = 0,
@ -191,7 +192,7 @@ private:
const AnalysisLevel Level; const AnalysisLevel Level;
}; };
struct DependenceAnalysis : public AnalysisInfoMixin<DependenceAnalysis> { struct DependenceAnalysis final : public AnalysisInfoMixin<DependenceAnalysis> {
static AnalysisKey Key; static AnalysisKey Key;
struct Result { struct Result {
Scop &S; Scop &S;
@ -212,8 +213,8 @@ struct DependenceAnalysis : public AnalysisInfoMixin<DependenceAnalysis> {
ScopStandardAnalysisResults &SAR); ScopStandardAnalysisResults &SAR);
}; };
struct DependenceInfoPrinterPass struct DependenceInfoPrinterPass final
: public PassInfoMixin<DependenceInfoPrinterPass> { : PassInfoMixin<DependenceInfoPrinterPass> {
DependenceInfoPrinterPass(raw_ostream &OS) : OS(OS) {} DependenceInfoPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Scop &S, ScopAnalysisManager &, PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
@ -222,7 +223,7 @@ struct DependenceInfoPrinterPass
raw_ostream &OS; raw_ostream &OS;
}; };
class DependenceInfo : public ScopPass { class DependenceInfo final : public ScopPass {
public: public:
static char ID; static char ID;
@ -266,7 +267,7 @@ llvm::Pass *createDependenceInfoPass();
llvm::Pass *createDependenceInfoPrinterLegacyPass(llvm::raw_ostream &OS); llvm::Pass *createDependenceInfoPrinterLegacyPass(llvm::raw_ostream &OS);
/// Construct a new DependenceInfoWrapper pass. /// Construct a new DependenceInfoWrapper pass.
class DependenceInfoWrapperPass : public FunctionPass { class DependenceInfoWrapperPass final : public FunctionPass {
public: public:
static char ID; static char ID;

View File

@ -23,14 +23,14 @@ namespace polly {
llvm::Pass *createForwardOpTreeWrapperPass(); llvm::Pass *createForwardOpTreeWrapperPass();
llvm::Pass *createForwardOpTreePrinterLegacyPass(llvm::raw_ostream &OS); llvm::Pass *createForwardOpTreePrinterLegacyPass(llvm::raw_ostream &OS);
struct ForwardOpTreePass : llvm::PassInfoMixin<ForwardOpTreePass> { struct ForwardOpTreePass final : llvm::PassInfoMixin<ForwardOpTreePass> {
ForwardOpTreePass() {} ForwardOpTreePass() {}
llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM, llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
ScopStandardAnalysisResults &SAR, SPMUpdater &U); ScopStandardAnalysisResults &SAR, SPMUpdater &U);
}; };
struct ForwardOpTreePrinterPass struct ForwardOpTreePrinterPass final
: llvm::PassInfoMixin<ForwardOpTreePrinterPass> { : llvm::PassInfoMixin<ForwardOpTreePrinterPass> {
ForwardOpTreePrinterPass(raw_ostream &OS) : OS(OS) {} ForwardOpTreePrinterPass(raw_ostream &OS) : OS(OS) {}

View File

@ -19,14 +19,14 @@ llvm::Pass *createJSONImporterPrinterLegacyPass(llvm::raw_ostream &OS);
/// This pass exports a scop to a jscop file. The filename is generated from the /// This pass exports a scop to a jscop file. The filename is generated from the
/// concatenation of the function and scop name. /// concatenation of the function and scop name.
struct JSONExportPass : public llvm::PassInfoMixin<JSONExportPass> { struct JSONExportPass final : llvm::PassInfoMixin<JSONExportPass> {
llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &, llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
ScopStandardAnalysisResults &, SPMUpdater &); ScopStandardAnalysisResults &, SPMUpdater &);
}; };
/// This pass imports a scop from a jscop file. The filename is deduced from the /// This pass imports a scop from a jscop file. The filename is deduced from the
/// concatenation of the function and scop name. /// concatenation of the function and scop name.
struct JSONImportPass : public llvm::PassInfoMixin<JSONExportPass> { struct JSONImportPass final : llvm::PassInfoMixin<JSONExportPass> {
llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &, llvm::PreservedAnalyses run(Scop &, ScopAnalysisManager &,
ScopStandardAnalysisResults &, SPMUpdater &); ScopStandardAnalysisResults &, SPMUpdater &);
}; };

View File

@ -21,7 +21,7 @@ class OptimizationRemarkEmitter;
namespace polly { namespace polly {
class Scop; class Scop;
struct Dependences; class Dependences;
/// Apply loop-transformation metadata. /// Apply loop-transformation metadata.
/// ///

View File

@ -16,7 +16,7 @@ class TargetTransformInfo;
} }
namespace polly { namespace polly {
struct Dependences; class Dependences;
/// Apply the BLIS matmul optimization pattern if possible. /// Apply the BLIS matmul optimization pattern if possible.
/// ///

View File

@ -31,7 +31,7 @@ class Scop;
class ScopInfo; class ScopInfo;
class DependenceInfoWrapperPass; class DependenceInfoWrapperPass;
class PolyhedralInfo : public llvm::FunctionPass { class PolyhedralInfo final : public llvm::FunctionPass {
public: public:
static char ID; // Pass identification, replacement for typeid static char ID; // Pass identification, replacement for typeid

View File

@ -23,7 +23,8 @@ class PassRegistry;
namespace polly { namespace polly {
llvm::Pass *createPruneUnprofitableWrapperPass(); llvm::Pass *createPruneUnprofitableWrapperPass();
struct PruneUnprofitablePass : llvm::PassInfoMixin<PruneUnprofitablePass> { struct PruneUnprofitablePass final
: llvm::PassInfoMixin<PruneUnprofitablePass> {
PruneUnprofitablePass() {} PruneUnprofitablePass() {}
llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM, llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,

View File

@ -20,7 +20,7 @@ namespace polly {
llvm::Pass *createIslScheduleOptimizerWrapperPass(); llvm::Pass *createIslScheduleOptimizerWrapperPass();
llvm::Pass *createIslScheduleOptimizerPrinterLegacyPass(llvm::raw_ostream &OS); llvm::Pass *createIslScheduleOptimizerPrinterLegacyPass(llvm::raw_ostream &OS);
struct IslScheduleOptimizerPass struct IslScheduleOptimizerPass final
: llvm::PassInfoMixin<IslScheduleOptimizerPass> { : llvm::PassInfoMixin<IslScheduleOptimizerPass> {
IslScheduleOptimizerPass() {} IslScheduleOptimizerPass() {}
@ -28,7 +28,7 @@ struct IslScheduleOptimizerPass
ScopStandardAnalysisResults &SAR, SPMUpdater &U); ScopStandardAnalysisResults &SAR, SPMUpdater &U);
}; };
struct IslScheduleOptimizerPrinterPass struct IslScheduleOptimizerPrinterPass final
: llvm::PassInfoMixin<IslScheduleOptimizerPrinterPass> { : llvm::PassInfoMixin<IslScheduleOptimizerPrinterPass> {
IslScheduleOptimizerPrinterPass(raw_ostream &OS) : OS(OS) {} IslScheduleOptimizerPrinterPass(raw_ostream &OS) : OS(OS) {}

View File

@ -126,7 +126,7 @@ struct ScheduleTreeVisitor {
/// Recursively visit all nodes of a schedule tree. /// Recursively visit all nodes of a schedule tree.
template <typename Derived, typename RetTy = void, typename... Args> template <typename Derived, typename RetTy = void, typename... Args>
struct RecursiveScheduleTreeVisitor struct RecursiveScheduleTreeVisitor
: public ScheduleTreeVisitor<Derived, RetTy, Args...> { : ScheduleTreeVisitor<Derived, RetTy, Args...> {
using BaseTy = ScheduleTreeVisitor<Derived, RetTy, Args...>; using BaseTy = ScheduleTreeVisitor<Derived, RetTy, Args...>;
BaseTy &getBase() { return *this; } BaseTy &getBase() { return *this; }
const BaseTy &getBase() const { return *this; } const BaseTy &getBase() const { return *this; }

View File

@ -30,7 +30,7 @@ class ScopDetection;
extern bool ModelReadOnlyScalars; extern bool ModelReadOnlyScalars;
/// Build the Polly IR (Scop and ScopStmt) on a Region. /// Build the Polly IR (Scop and ScopStmt) on a Region.
class ScopBuilder { class ScopBuilder final {
/// The AAResults to build AliasSetTracker. /// The AAResults to build AliasSetTracker.
AAResults &AA; AAResults &AA;

View File

@ -627,7 +627,7 @@ private:
OptimizationRemarkEmitter &ORE; OptimizationRemarkEmitter &ORE;
}; };
struct ScopAnalysis : public AnalysisInfoMixin<ScopAnalysis> { struct ScopAnalysis : AnalysisInfoMixin<ScopAnalysis> {
static AnalysisKey Key; static AnalysisKey Key;
using Result = ScopDetection; using Result = ScopDetection;
@ -637,7 +637,7 @@ struct ScopAnalysis : public AnalysisInfoMixin<ScopAnalysis> {
Result run(Function &F, FunctionAnalysisManager &FAM); Result run(Function &F, FunctionAnalysisManager &FAM);
}; };
struct ScopAnalysisPrinterPass : public PassInfoMixin<ScopAnalysisPrinterPass> { struct ScopAnalysisPrinterPass final : PassInfoMixin<ScopAnalysisPrinterPass> {
ScopAnalysisPrinterPass(raw_ostream &OS) : OS(OS) {} ScopAnalysisPrinterPass(raw_ostream &OS) : OS(OS) {}
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
@ -645,19 +645,20 @@ struct ScopAnalysisPrinterPass : public PassInfoMixin<ScopAnalysisPrinterPass> {
raw_ostream &OS; raw_ostream &OS;
}; };
struct ScopDetectionWrapperPass : public FunctionPass { class ScopDetectionWrapperPass final : public FunctionPass {
static char ID;
std::unique_ptr<ScopDetection> Result; std::unique_ptr<ScopDetection> Result;
public:
ScopDetectionWrapperPass(); ScopDetectionWrapperPass();
/// @name FunctionPass interface /// @name FunctionPass interface
//@{ ///@{
static char ID;
void getAnalysisUsage(AnalysisUsage &AU) const override; void getAnalysisUsage(AnalysisUsage &AU) const override;
void releaseMemory() override; void releaseMemory() override;
bool runOnFunction(Function &F) override; bool runOnFunction(Function &F) override;
void print(raw_ostream &OS, const Module *M = nullptr) const override; void print(raw_ostream &OS, const Module *M = nullptr) const override;
//@} ///@}
ScopDetection &getSD() const { return *Result; } ScopDetection &getSD() const { return *Result; }
}; };

View File

@ -163,7 +163,7 @@ public:
using RejectReasonPtr = std::shared_ptr<RejectReason>; using RejectReasonPtr = std::shared_ptr<RejectReason>;
/// Stores all errors that occurred during the detection. /// Stores all errors that occurred during the detection.
class RejectLog { class RejectLog final {
Region *R; Region *R;
SmallVector<RejectReasonPtr, 1> ErrorReports; SmallVector<RejectReasonPtr, 1> ErrorReports;
@ -204,7 +204,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures bad terminator within a Scop candidate. /// Captures bad terminator within a Scop candidate.
class ReportInvalidTerminator : public ReportCFG { class ReportInvalidTerminator final : public ReportCFG {
BasicBlock *BB; BasicBlock *BB;
public: public:
@ -227,7 +227,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures irreducible regions in CFG. /// Captures irreducible regions in CFG.
class ReportIrreducibleRegion : public ReportCFG { class ReportIrreducibleRegion final : public ReportCFG {
Region *R; Region *R;
DebugLoc DbgLoc; DebugLoc DbgLoc;
@ -252,7 +252,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures regions with an unreachable in the exit block. /// Captures regions with an unreachable in the exit block.
class ReportUnreachableInExit : public ReportCFG { class ReportUnreachableInExit final : public ReportCFG {
BasicBlock *BB; BasicBlock *BB;
DebugLoc DbgLoc; DebugLoc DbgLoc;
@ -278,7 +278,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures regions with an IndirectBr predecessor. /// Captures regions with an IndirectBr predecessor.
class ReportIndirectPredecessor : public ReportCFG { class ReportIndirectPredecessor final : public ReportCFG {
Instruction *Inst; Instruction *Inst;
DebugLoc DbgLoc; DebugLoc DbgLoc;
@ -328,7 +328,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures a condition that is based on an 'undef' value. /// Captures a condition that is based on an 'undef' value.
class ReportUndefCond : public ReportAffFunc { class ReportUndefCond final : public ReportAffFunc {
// The BasicBlock we found the broken condition in. // The BasicBlock we found the broken condition in.
BasicBlock *BB; BasicBlock *BB;
@ -353,7 +353,7 @@ public:
/// Captures an invalid condition /// Captures an invalid condition
/// ///
/// Conditions have to be either constants or icmp instructions. /// Conditions have to be either constants or icmp instructions.
class ReportInvalidCond : public ReportAffFunc { class ReportInvalidCond final : public ReportAffFunc {
// The BasicBlock we found the broken condition in. // The BasicBlock we found the broken condition in.
BasicBlock *BB; BasicBlock *BB;
@ -376,7 +376,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures an undefined operand. /// Captures an undefined operand.
class ReportUndefOperand : public ReportAffFunc { class ReportUndefOperand final : public ReportAffFunc {
// The BasicBlock we found the undefined operand in. // The BasicBlock we found the undefined operand in.
BasicBlock *BB; BasicBlock *BB;
@ -399,7 +399,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures a non-affine branch. /// Captures a non-affine branch.
class ReportNonAffBranch : public ReportAffFunc { class ReportNonAffBranch final : public ReportAffFunc {
// The BasicBlock we found the non-affine branch in. // The BasicBlock we found the non-affine branch in.
BasicBlock *BB; BasicBlock *BB;
@ -433,7 +433,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures a missing base pointer. /// Captures a missing base pointer.
class ReportNoBasePtr : public ReportAffFunc { class ReportNoBasePtr final : public ReportAffFunc {
public: public:
ReportNoBasePtr(const Instruction *Inst) ReportNoBasePtr(const Instruction *Inst)
: ReportAffFunc(RejectReasonKind::NoBasePtr, Inst) {} : ReportAffFunc(RejectReasonKind::NoBasePtr, Inst) {}
@ -453,7 +453,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures an undefined base pointer. /// Captures an undefined base pointer.
class ReportUndefBasePtr : public ReportAffFunc { class ReportUndefBasePtr final : public ReportAffFunc {
public: public:
ReportUndefBasePtr(const Instruction *Inst) ReportUndefBasePtr(const Instruction *Inst)
: ReportAffFunc(RejectReasonKind::UndefBasePtr, Inst) {} : ReportAffFunc(RejectReasonKind::UndefBasePtr, Inst) {}
@ -473,7 +473,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures a base pointer that is not invariant in the region. /// Captures a base pointer that is not invariant in the region.
class ReportVariantBasePtr : public ReportAffFunc { class ReportVariantBasePtr final : public ReportAffFunc {
// The variant base pointer. // The variant base pointer.
Value *BaseValue; Value *BaseValue;
@ -498,7 +498,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures a non-affine access function. /// Captures a non-affine access function.
class ReportNonAffineAccess : public ReportAffFunc { class ReportNonAffineAccess final : public ReportAffFunc {
// The non-affine access function. // The non-affine access function.
const SCEV *AccessFunction; const SCEV *AccessFunction;
@ -529,7 +529,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Report array accesses with differing element size. /// Report array accesses with differing element size.
class ReportDifferentArrayElementSize : public ReportAffFunc { class ReportDifferentArrayElementSize final : public ReportAffFunc {
// The base pointer of the memory access. // The base pointer of the memory access.
const Value *BaseValue; const Value *BaseValue;
@ -554,7 +554,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors with non affine loop bounds. /// Captures errors with non affine loop bounds.
class ReportLoopBound : public RejectReason { class ReportLoopBound final : public RejectReason {
// The offending loop. // The offending loop.
Loop *L; Loop *L;
@ -586,7 +586,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors when loop has no exit. /// Captures errors when loop has no exit.
class ReportLoopHasNoExit : public RejectReason { class ReportLoopHasNoExit final : public RejectReason {
/// The loop that has no exit. /// The loop that has no exit.
Loop *L; Loop *L;
@ -614,7 +614,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors when a loop has multiple exists. /// Captures errors when a loop has multiple exists.
class ReportLoopHasMultipleExits : public RejectReason { class ReportLoopHasMultipleExits final : public RejectReason {
/// The loop that has multiple exits. /// The loop that has multiple exits.
Loop *L; Loop *L;
@ -642,7 +642,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors when not all loop latches are part of the scop. /// Captures errors when not all loop latches are part of the scop.
class ReportLoopOnlySomeLatches : public RejectReason { class ReportLoopOnlySomeLatches final : public RejectReason {
/// The loop for which not all loop latches are part of the scop. /// The loop for which not all loop latches are part of the scop.
Loop *L; Loop *L;
@ -670,7 +670,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors with non-side-effect-known function calls. /// Captures errors with non-side-effect-known function calls.
class ReportFuncCall : public RejectReason { class ReportFuncCall final : public RejectReason {
// The offending call instruction. // The offending call instruction.
Instruction *Inst; Instruction *Inst;
@ -694,7 +694,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors with aliasing. /// Captures errors with aliasing.
class ReportAlias : public RejectReason { class ReportAlias final : public RejectReason {
public: public:
using PointerSnapshotTy = std::vector<const Value *>; using PointerSnapshotTy = std::vector<const Value *>;
@ -751,7 +751,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors with bad IntToPtr instructions. /// Captures errors with bad IntToPtr instructions.
class ReportIntToPtr : public ReportOther { class ReportIntToPtr final : public ReportOther {
// The offending base value. // The offending base value.
Instruction *BaseValue; Instruction *BaseValue;
@ -774,7 +774,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors with alloca instructions. /// Captures errors with alloca instructions.
class ReportAlloca : public ReportOther { class ReportAlloca final : public ReportOther {
Instruction *Inst; Instruction *Inst;
public: public:
@ -796,7 +796,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors with unknown instructions. /// Captures errors with unknown instructions.
class ReportUnknownInst : public ReportOther { class ReportUnknownInst final : public ReportOther {
Instruction *Inst; Instruction *Inst;
public: public:
@ -818,7 +818,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors with regions containing the function entry block. /// Captures errors with regions containing the function entry block.
class ReportEntry : public ReportOther { class ReportEntry final : public ReportOther {
BasicBlock *BB; BasicBlock *BB;
public: public:
@ -841,7 +841,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Report regions that seem not profitable to be optimized. /// Report regions that seem not profitable to be optimized.
class ReportUnprofitable : public ReportOther { class ReportUnprofitable final : public ReportOther {
Region *R; Region *R;
public: public:
@ -864,7 +864,7 @@ public:
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Captures errors with non-simple memory accesses. /// Captures errors with non-simple memory accesses.
class ReportNonSimpleMemoryAccess : public ReportOther { class ReportNonSimpleMemoryAccess final : public ReportOther {
// The offending call instruction. // The offending call instruction.
Instruction *Inst; Instruction *Inst;

View File

@ -27,7 +27,7 @@
namespace llvm { namespace llvm {
template <> template <>
struct GraphTraits<polly::ScopDetection *> : public GraphTraits<RegionInfo *> { struct GraphTraits<polly::ScopDetection *> : GraphTraits<RegionInfo *> {
static NodeRef getEntryNode(polly::ScopDetection *SD) { static NodeRef getEntryNode(polly::ScopDetection *SD) {
return GraphTraits<RegionInfo *>::getEntryNode(SD->getRI()); return GraphTraits<RegionInfo *>::getEntryNode(SD->getRI());
} }
@ -40,8 +40,7 @@ struct GraphTraits<polly::ScopDetection *> : public GraphTraits<RegionInfo *> {
}; };
template <> template <>
struct DOTGraphTraits<polly::ScopDetection *> struct DOTGraphTraits<polly::ScopDetection *> : DOTGraphTraits<RegionNode *> {
: public DOTGraphTraits<RegionNode *> {
DOTGraphTraits(bool isSimple = false) DOTGraphTraits(bool isSimple = false)
: DOTGraphTraits<RegionNode *>(isSimple) {} : DOTGraphTraits<RegionNode *>(isSimple) {}
static std::string getGraphName(polly::ScopDetection *SD) { static std::string getGraphName(polly::ScopDetection *SD) {
@ -71,23 +70,22 @@ struct DOTGraphTraits<polly::ScopDetection *>
namespace polly { namespace polly {
struct ScopViewer : public llvm::DOTGraphTraitsViewer<ScopAnalysis, false> { struct ScopViewer final : llvm::DOTGraphTraitsViewer<ScopAnalysis, false> {
ScopViewer() : llvm::DOTGraphTraitsViewer<ScopAnalysis, false>("scops") {} ScopViewer() : llvm::DOTGraphTraitsViewer<ScopAnalysis, false>("scops") {}
bool processFunction(Function &F, const ScopDetection &SD) override; bool processFunction(Function &F, const ScopDetection &SD) override;
}; };
struct ScopOnlyViewer : public llvm::DOTGraphTraitsViewer<ScopAnalysis, false> { struct ScopOnlyViewer final : llvm::DOTGraphTraitsViewer<ScopAnalysis, false> {
ScopOnlyViewer() ScopOnlyViewer()
: llvm::DOTGraphTraitsViewer<ScopAnalysis, false>("scops-only") {} : llvm::DOTGraphTraitsViewer<ScopAnalysis, false>("scops-only") {}
}; };
struct ScopPrinter : public llvm::DOTGraphTraitsPrinter<ScopAnalysis, false> { struct ScopPrinter final : llvm::DOTGraphTraitsPrinter<ScopAnalysis, false> {
ScopPrinter() : llvm::DOTGraphTraitsPrinter<ScopAnalysis, false>("scops") {} ScopPrinter() : llvm::DOTGraphTraitsPrinter<ScopAnalysis, false>("scops") {}
}; };
struct ScopOnlyPrinter struct ScopOnlyPrinter final : llvm::DOTGraphTraitsPrinter<ScopAnalysis, true> {
: public llvm::DOTGraphTraitsPrinter<ScopAnalysis, true> {
ScopOnlyPrinter() ScopOnlyPrinter()
: llvm::DOTGraphTraitsPrinter<ScopAnalysis, true>("scopsonly") {} : llvm::DOTGraphTraitsPrinter<ScopAnalysis, true>("scopsonly") {}
}; };

View File

@ -216,7 +216,7 @@ using AccFuncVector = std::vector<std::unique_ptr<MemoryAccess>>;
/// Objects are accessible via the ScoP, MemoryAccess or the id associated with /// Objects are accessible via the ScoP, MemoryAccess or the id associated with
/// the MemoryAccess access function. /// the MemoryAccess access function.
/// ///
class ScopArrayInfo { class ScopArrayInfo final {
public: public:
/// Construct a ScopArrayInfo object. /// Construct a ScopArrayInfo object.
/// ///
@ -428,7 +428,7 @@ private:
}; };
/// Represent memory accesses in statements. /// Represent memory accesses in statements.
class MemoryAccess { class MemoryAccess final {
friend class Scop; friend class Scop;
friend class ScopStmt; friend class ScopStmt;
friend class ScopBuilder; friend class ScopBuilder;
@ -1135,7 +1135,7 @@ using InvariantEquivClassesTy = SmallVector<InvariantEquivClassTy, 8>;
/// It is further described by its iteration domain, its schedule and its data /// It is further described by its iteration domain, its schedule and its data
/// accesses. /// accesses.
/// At the moment every statement represents a single basic block of LLVM-IR. /// At the moment every statement represents a single basic block of LLVM-IR.
class ScopStmt { class ScopStmt final {
friend class ScopBuilder; friend class ScopBuilder;
public: public:
@ -1626,7 +1626,7 @@ raw_ostream &operator<<(raw_ostream &OS, const ScopStmt &S);
/// * A context /// * A context
/// This context contains information about the values the parameters /// This context contains information about the values the parameters
/// can take and relations between different parameters. /// can take and relations between different parameters.
class Scop { class Scop final {
public: public:
/// Type to represent a pair of minimal/maximal access to an array. /// Type to represent a pair of minimal/maximal access to an array.
using MinMaxAccessTy = std::pair<isl::pw_multi_aff, isl::pw_multi_aff>; using MinMaxAccessTy = std::pair<isl::pw_multi_aff, isl::pw_multi_aff>;
@ -2684,7 +2684,7 @@ raw_ostream &operator<<(raw_ostream &OS, const Scop &scop);
/// The legacy pass manager's analysis pass to compute scop information /// The legacy pass manager's analysis pass to compute scop information
/// for a region. /// for a region.
class ScopInfoRegionPass : public RegionPass { class ScopInfoRegionPass final : public RegionPass {
/// The Scop pointer which is used to construct a Scop. /// The Scop pointer which is used to construct a Scop.
std::unique_ptr<Scop> S; std::unique_ptr<Scop> S;
@ -2774,7 +2774,7 @@ public:
bool empty() const { return RegionToScopMap.empty(); } bool empty() const { return RegionToScopMap.empty(); }
}; };
struct ScopInfoAnalysis : public AnalysisInfoMixin<ScopInfoAnalysis> { struct ScopInfoAnalysis : AnalysisInfoMixin<ScopInfoAnalysis> {
static AnalysisKey Key; static AnalysisKey Key;
using Result = ScopInfo; using Result = ScopInfo;
@ -2782,7 +2782,7 @@ struct ScopInfoAnalysis : public AnalysisInfoMixin<ScopInfoAnalysis> {
Result run(Function &, FunctionAnalysisManager &); Result run(Function &, FunctionAnalysisManager &);
}; };
struct ScopInfoPrinterPass : public PassInfoMixin<ScopInfoPrinterPass> { struct ScopInfoPrinterPass final : PassInfoMixin<ScopInfoPrinterPass> {
ScopInfoPrinterPass(raw_ostream &OS) : Stream(OS) {} ScopInfoPrinterPass(raw_ostream &OS) : Stream(OS) {}
PreservedAnalyses run(Function &, FunctionAnalysisManager &); PreservedAnalyses run(Function &, FunctionAnalysisManager &);
@ -2798,7 +2798,7 @@ struct ScopInfoPrinterPass : public PassInfoMixin<ScopInfoPrinterPass> {
/// scop object for all the feasible scops present in a function. /// scop object for all the feasible scops present in a function.
/// This pass is an alternative to the ScopInfoRegionPass in order to avoid a /// This pass is an alternative to the ScopInfoRegionPass in order to avoid a
/// region pass manager. /// region pass manager.
class ScopInfoWrapperPass : public FunctionPass { class ScopInfoWrapperPass final : public FunctionPass {
std::unique_ptr<ScopInfo> Result; std::unique_ptr<ScopInfo> Result;
public: public:

View File

@ -124,7 +124,7 @@ extern template class OuterAnalysisManagerProxy<FunctionAnalysisManager, Scop,
namespace polly { namespace polly {
template <typename AnalysisManagerT, typename IRUnitT, typename... ExtraArgTs> template <typename AnalysisManagerT, typename IRUnitT, typename... ExtraArgTs>
class OwningInnerAnalysisManagerProxy class OwningInnerAnalysisManagerProxy final
: public InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT> { : public InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT> {
public: public:
OwningInnerAnalysisManagerProxy() OwningInnerAnalysisManagerProxy()
@ -191,7 +191,7 @@ struct ScopStandardAnalysisResults {
TargetTransformInfo &TTI; TargetTransformInfo &TTI;
}; };
class SPMUpdater { class SPMUpdater final {
public: public:
SPMUpdater(SmallPriorityWorklist<Region *, 4> &Worklist, SPMUpdater(SmallPriorityWorklist<Region *, 4> &Worklist,
ScopAnalysisManager &SAM) ScopAnalysisManager &SAM)
@ -212,13 +212,12 @@ private:
bool InvalidateCurrentScop; bool InvalidateCurrentScop;
SmallPriorityWorklist<Region *, 4> &Worklist; SmallPriorityWorklist<Region *, 4> &Worklist;
ScopAnalysisManager &SAM; ScopAnalysisManager &SAM;
template <typename ScopPassT> friend class FunctionToScopPassAdaptor; template <typename ScopPassT> friend struct FunctionToScopPassAdaptor;
}; };
template <typename ScopPassT> template <typename ScopPassT>
class FunctionToScopPassAdaptor struct FunctionToScopPassAdaptor final
: public PassInfoMixin<FunctionToScopPassAdaptor<ScopPassT>> { : PassInfoMixin<FunctionToScopPassAdaptor<ScopPassT>> {
public:
explicit FunctionToScopPassAdaptor(ScopPassT Pass) : Pass(std::move(Pass)) {} explicit FunctionToScopPassAdaptor(ScopPassT Pass) : Pass(std::move(Pass)) {}
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM) { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM) {

View File

@ -52,7 +52,7 @@ llvm::SmallVector<MemoryAccess *, 32> getAccessesInOrder(ScopStmt &Stmt);
llvm::Pass *createSimplifyWrapperPass(int CallNo = 0); llvm::Pass *createSimplifyWrapperPass(int CallNo = 0);
llvm::Pass *createSimplifyPrinterLegacyPass(llvm::raw_ostream &OS); llvm::Pass *createSimplifyPrinterLegacyPass(llvm::raw_ostream &OS);
struct SimplifyPass : public PassInfoMixin<SimplifyPass> { struct SimplifyPass final : PassInfoMixin<SimplifyPass> {
SimplifyPass(int CallNo = 0) : CallNo(CallNo) {} SimplifyPass(int CallNo = 0) : CallNo(CallNo) {}
llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM, llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
@ -62,7 +62,7 @@ private:
int CallNo; int CallNo;
}; };
struct SimplifyPrinterPass : public PassInfoMixin<SimplifyPrinterPass> { struct SimplifyPrinterPass final : PassInfoMixin<SimplifyPrinterPass> {
SimplifyPrinterPass(raw_ostream &OS, int CallNo = 0) SimplifyPrinterPass(raw_ostream &OS, int CallNo = 0)
: OS(OS), CallNo(CallNo) {} : OS(OS), CallNo(CallNo) {}

View File

@ -25,7 +25,7 @@ namespace polly {
llvm::FunctionPass *createDumpFunctionWrapperPass(std::string Suffix); llvm::FunctionPass *createDumpFunctionWrapperPass(std::string Suffix);
/// A pass that isolates a function into a new Module and writes it into a file. /// A pass that isolates a function into a new Module and writes it into a file.
struct DumpFunctionPass : llvm::PassInfoMixin<DumpFunctionPass> { struct DumpFunctionPass final : llvm::PassInfoMixin<DumpFunctionPass> {
std::string Suffix; std::string Suffix;
DumpFunctionPass(std::string Suffix) : Suffix(std::move(Suffix)) {} DumpFunctionPass(std::string Suffix) : Suffix(std::move(Suffix)) {}

View File

@ -34,7 +34,7 @@ llvm::ModulePass *createDumpModuleWrapperPass(std::string Filename,
bool IsSuffix); bool IsSuffix);
/// A pass that prints the module into a file. /// A pass that prints the module into a file.
struct DumpModulePass : llvm::PassInfoMixin<DumpModulePass> { struct DumpModulePass final : llvm::PassInfoMixin<DumpModulePass> {
std::string Filename; std::string Filename;
bool IsSuffix; bool IsSuffix;

View File

@ -354,7 +354,7 @@ operator<<(llvm::DiagnosticInfoOptimizationBase &OS,
/// This is typically used inside a nested IslMaxOperationsGuard scope. The /// This is typically used inside a nested IslMaxOperationsGuard scope. The
/// IslMaxOperationsGuard defines the number of allowed base operations for some /// IslMaxOperationsGuard defines the number of allowed base operations for some
/// code, IslQuotaScope defines where it is allowed to return an error result. /// code, IslQuotaScope defines where it is allowed to return an error result.
class IslQuotaScope { class IslQuotaScope final {
isl_ctx *IslCtx; isl_ctx *IslCtx;
int OldOnError; int OldOnError;
@ -421,7 +421,7 @@ public:
/// counter cannot be reset to the previous state, or one that adds the /// counter cannot be reset to the previous state, or one that adds the
/// operations while being in the nested scope. Use therefore is only allowed /// operations while being in the nested scope. Use therefore is only allowed
/// while currently a no operations-limit is active. /// while currently a no operations-limit is active.
class IslMaxOperationsGuard { class IslMaxOperationsGuard final {
private: private:
/// The ISL context to set the operations limit. /// The ISL context to set the operations limit.
/// ///

View File

@ -48,11 +48,11 @@ template <typename ListT>
using list_element_type = decltype(std::declval<ListT>().get_at(0)); using list_element_type = decltype(std::declval<ListT>().get_at(0));
template <typename ListT> template <typename ListT>
struct isl_iterator class isl_iterator
: public llvm::iterator_facade_base<isl_iterator<ListT>, : public llvm::iterator_facade_base<isl_iterator<ListT>,
std::forward_iterator_tag, std::forward_iterator_tag,
list_element_type<ListT>> { list_element_type<ListT>> {
public:
using ElementT = list_element_type<ListT>; using ElementT = list_element_type<ListT>;
explicit isl_iterator(const ListT &List) explicit isl_iterator(const ListT &List)

View File

@ -27,7 +27,7 @@ class Scop;
typedef std::pair<isl::pw_aff, isl::set> PWACtx; typedef std::pair<isl::pw_aff, isl::set> PWACtx;
/// Translate a SCEV to an isl::pw_aff and the domain on which it is invalid. /// Translate a SCEV to an isl::pw_aff and the domain on which it is invalid.
struct SCEVAffinator : public llvm::SCEVVisitor<SCEVAffinator, PWACtx> { class SCEVAffinator final : public llvm::SCEVVisitor<SCEVAffinator, PWACtx> {
public: public:
SCEVAffinator(Scop *S, llvm::LoopInfo &LI); SCEVAffinator(Scop *S, llvm::LoopInfo &LI);

View File

@ -133,7 +133,7 @@ using BoxedLoopsSetTy = llvm::SetVector<const llvm::Loop *>;
/// is currently not supported in C++ such that those cannot be used directly. /// is currently not supported in C++ such that those cannot be used directly.
/// (llvm::isa could, but then llvm:cast etc. would not have the expected /// (llvm::isa could, but then llvm:cast etc. would not have the expected
/// behavior) /// behavior)
class MemAccInst { class MemAccInst final {
private: private:
llvm::Instruction *I; llvm::Instruction *I;

View File

@ -28,7 +28,7 @@ using llvm::User;
/// Despite its name it is not tied to virtual instructions (although it works /// Despite its name it is not tied to virtual instructions (although it works
/// fine with them), but to promote consistent handling of values used in /// fine with them), but to promote consistent handling of values used in
/// statements. /// statements.
class VirtualUse { class VirtualUse final {
public: public:
/// The different types of uses. Handling usually differentiates a lot between /// The different types of uses. Handling usually differentiates a lot between
/// these; one can use a switch to handle each case (and get warned by the /// these; one can use a switch to handle each case (and get warned by the
@ -167,7 +167,7 @@ public:
}; };
/// An iterator for virtual operands. /// An iterator for virtual operands.
class VirtualOperandIterator { class VirtualOperandIterator final {
friend class VirtualInstruction; friend class VirtualInstruction;
friend class VirtualUse; friend class VirtualUse;
@ -228,7 +228,7 @@ public:
/// ScopStmt/Instruction-pair uniquely identifies a virtual instructions. /// ScopStmt/Instruction-pair uniquely identifies a virtual instructions.
/// ScopStmt::getInstruction() can contain the same instruction multiple times, /// ScopStmt::getInstruction() can contain the same instruction multiple times,
/// but they necessarily compute the same value. /// but they necessarily compute the same value.
class VirtualInstruction { class VirtualInstruction final {
friend class VirtualOperandIterator; friend class VirtualOperandIterator;
friend struct llvm::DenseMapInfo<VirtualInstruction>; friend struct llvm::DenseMapInfo<VirtualInstruction>;

View File

@ -930,7 +930,7 @@ INITIALIZE_PASS_END(DependenceInfo, "polly-dependences",
namespace { namespace {
/// Print result from DependenceAnalysis. /// Print result from DependenceAnalysis.
class DependenceInfoPrinterLegacyPass : public ScopPass { class DependenceInfoPrinterLegacyPass final : public ScopPass {
public: public:
static char ID; static char ID;
@ -1037,7 +1037,7 @@ INITIALIZE_PASS_END(
namespace { namespace {
/// Print result from DependenceInfoWrapperPass. /// Print result from DependenceInfoWrapperPass.
class DependenceInfoPrinterLegacyFunctionPass : public FunctionPass { class DependenceInfoPrinterLegacyFunctionPass final : public FunctionPass {
public: public:
static char ID; static char ID;

View File

@ -170,7 +170,7 @@ INITIALIZE_PASS_END(PolyhedralInfo, "polyhedral-info",
namespace { namespace {
/// Print result from PolyhedralInfo. /// Print result from PolyhedralInfo.
class PolyhedralInfoPrinterLegacyPass : public FunctionPass { class PolyhedralInfoPrinterLegacyPass final : public FunctionPass {
public: public:
static char ID; static char ID;

View File

@ -78,7 +78,7 @@ static bool runPruneUnprofitable(Scop &S) {
return false; return false;
} }
class PruneUnprofitableWrapperPass : public ScopPass { class PruneUnprofitableWrapperPass final : public ScopPass {
public: public:
static char ID; static char ID;

View File

@ -281,7 +281,7 @@ static void updateLoopCountStatistic(ScopDetection::LoopStats Stats,
namespace { namespace {
class DiagnosticScopFound : public DiagnosticInfo { class DiagnosticScopFound final : public DiagnosticInfo {
private: private:
static int PluginDiagnosticKind; static int PluginDiagnosticKind;
@ -850,7 +850,7 @@ namespace {
/// always add and verify the assumption that for all subscript expressions /// always add and verify the assumption that for all subscript expressions
/// 'exp' the inequality 0 <= exp < size holds. Hence, we will also verify /// 'exp' the inequality 0 <= exp < size holds. Hence, we will also verify
/// that 0 <= size, which means smax(0, size) == size. /// that 0 <= size, which means smax(0, size) == size.
class SCEVRemoveMax : public SCEVRewriteVisitor<SCEVRemoveMax> { class SCEVRemoveMax final : public SCEVRewriteVisitor<SCEVRemoveMax> {
public: public:
SCEVRemoveMax(ScalarEvolution &SE, std::vector<const SCEV *> *Terms) SCEVRemoveMax(ScalarEvolution &SE, std::vector<const SCEV *> *Terms)
: SCEVRewriteVisitor(SE), Terms(Terms) {} : SCEVRewriteVisitor(SE), Terms(Terms) {}
@ -2048,7 +2048,7 @@ INITIALIZE_PASS_END(ScopDetectionWrapperPass, "polly-detect",
namespace { namespace {
/// Print result from ScopDetectionWrapperPass. /// Print result from ScopDetectionWrapperPass.
class ScopDetectionPrinterLegacyPass : public FunctionPass { class ScopDetectionPrinterLegacyPass final : public FunctionPass {
public: public:
static char ID; static char ID;

View File

@ -141,9 +141,9 @@ struct ScopDetectionAnalysisGraphTraits {
}; };
struct ScopViewerWrapperPass struct ScopViewerWrapperPass
: public DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false, : DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
ScopDetection *, ScopDetection *,
ScopDetectionAnalysisGraphTraits> { ScopDetectionAnalysisGraphTraits> {
static char ID; static char ID;
ScopViewerWrapperPass() ScopViewerWrapperPass()
: DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false, : DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
@ -164,9 +164,9 @@ struct ScopViewerWrapperPass
char ScopViewerWrapperPass::ID = 0; char ScopViewerWrapperPass::ID = 0;
struct ScopOnlyViewerWrapperPass struct ScopOnlyViewerWrapperPass
: public DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false, : DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
ScopDetection *, ScopDetection *,
ScopDetectionAnalysisGraphTraits> { ScopDetectionAnalysisGraphTraits> {
static char ID; static char ID;
ScopOnlyViewerWrapperPass() ScopOnlyViewerWrapperPass()
: DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false, : DOTGraphTraitsViewerWrapperPass<ScopDetectionWrapperPass, false,
@ -177,9 +177,9 @@ struct ScopOnlyViewerWrapperPass
char ScopOnlyViewerWrapperPass::ID = 0; char ScopOnlyViewerWrapperPass::ID = 0;
struct ScopPrinterWrapperPass struct ScopPrinterWrapperPass
: public DOTGraphTraitsPrinterWrapperPass< : DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, false,
ScopDetectionWrapperPass, false, ScopDetection *, ScopDetection *,
ScopDetectionAnalysisGraphTraits> { ScopDetectionAnalysisGraphTraits> {
static char ID; static char ID;
ScopPrinterWrapperPass() ScopPrinterWrapperPass()
: DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, false, : DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, false,
@ -190,9 +190,9 @@ struct ScopPrinterWrapperPass
char ScopPrinterWrapperPass::ID = 0; char ScopPrinterWrapperPass::ID = 0;
struct ScopOnlyPrinterWrapperPass struct ScopOnlyPrinterWrapperPass
: public DOTGraphTraitsPrinterWrapperPass< : DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, true,
ScopDetectionWrapperPass, true, ScopDetection *, ScopDetection *,
ScopDetectionAnalysisGraphTraits> { ScopDetectionAnalysisGraphTraits> {
static char ID; static char ID;
ScopOnlyPrinterWrapperPass() ScopOnlyPrinterWrapperPass()
: DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, true, : DOTGraphTraitsPrinterWrapperPass<ScopDetectionWrapperPass, true,

View File

@ -1358,7 +1358,7 @@ void Scop::setContext(isl::set NewContext) {
namespace { namespace {
/// Remap parameter values but keep AddRecs valid wrt. invariant loads. /// Remap parameter values but keep AddRecs valid wrt. invariant loads.
struct SCEVSensitiveParameterRewriter class SCEVSensitiveParameterRewriter final
: public SCEVRewriteVisitor<SCEVSensitiveParameterRewriter> { : public SCEVRewriteVisitor<SCEVSensitiveParameterRewriter> {
const ValueToValueMap &VMap; const ValueToValueMap &VMap;
@ -1389,7 +1389,7 @@ public:
}; };
/// Check whether we should remap a SCEV expression. /// Check whether we should remap a SCEV expression.
struct SCEVFindInsideScop : public SCEVTraversal<SCEVFindInsideScop> { class SCEVFindInsideScop : public SCEVTraversal<SCEVFindInsideScop> {
const ValueToValueMap &VMap; const ValueToValueMap &VMap;
bool FoundInside = false; bool FoundInside = false;
const Scop *S; const Scop *S;
@ -2647,7 +2647,7 @@ INITIALIZE_PASS_END(ScopInfoRegionPass, "polly-scops",
namespace { namespace {
/// Print result from ScopInfoRegionPass. /// Print result from ScopInfoRegionPass.
class ScopInfoPrinterLegacyRegionPass : public RegionPass { class ScopInfoPrinterLegacyRegionPass final : public RegionPass {
public: public:
static char ID; static char ID;
@ -2829,7 +2829,7 @@ INITIALIZE_PASS_END(
namespace { namespace {
/// Print result from ScopInfoWrapperPass. /// Print result from ScopInfoWrapperPass.
class ScopInfoPrinterLegacyFunctionPass : public FunctionPass { class ScopInfoPrinterLegacyFunctionPass final : public FunctionPass {
public: public:
static char ID; static char ID;

View File

@ -303,7 +303,7 @@ static bool generateCode(Scop &S, IslAstInfo &AI, LoopInfo &LI,
namespace { namespace {
class CodeGeneration : public ScopPass { class CodeGeneration final : public ScopPass {
public: public:
static char ID; static char ID;

View File

@ -27,7 +27,7 @@ using namespace polly;
namespace { namespace {
class CodegenCleanup : public FunctionPass { class CodegenCleanup final : public FunctionPass {
private: private:
CodegenCleanup(const CodegenCleanup &) = delete; CodegenCleanup(const CodegenCleanup &) = delete;
const CodegenCleanup &operator=(const CodegenCleanup &) = delete; const CodegenCleanup &operator=(const CodegenCleanup &) = delete;

View File

@ -828,7 +828,7 @@ INITIALIZE_PASS_END(IslAstInfoWrapperPass, "polly-ast",
namespace { namespace {
/// Print result from IslAstInfoWrapperPass. /// Print result from IslAstInfoWrapperPass.
class IslAstInfoPrinterLegacyPass : public ScopPass { class IslAstInfoPrinterLegacyPass final : public ScopPass {
public: public:
static char ID; static char ID;

View File

@ -246,7 +246,7 @@ static void findReferencesInStmt(ScopStmt *Stmt, SetVector<Value *> &Values,
void polly::addReferencesFromStmt(ScopStmt *Stmt, void *UserPtr, void polly::addReferencesFromStmt(ScopStmt *Stmt, void *UserPtr,
bool CreateScalarRefs) { bool CreateScalarRefs) {
auto &References = *static_cast<struct SubtreeReferences *>(UserPtr); auto &References = *static_cast<SubtreeReferences *>(UserPtr);
findReferencesInStmt(Stmt, References.Values, References.GlobalMap, findReferencesInStmt(Stmt, References.Values, References.GlobalMap,
References.SCEVs); References.SCEVs);
@ -284,8 +284,7 @@ void polly::addReferencesFromStmt(ScopStmt *Stmt, void *UserPtr,
/// @param Set A set which references the ScopStmt we are interested in. /// @param Set A set which references the ScopStmt we are interested in.
/// @param UserPtr A void pointer that can be casted to a SubtreeReferences /// @param UserPtr A void pointer that can be casted to a SubtreeReferences
/// structure. /// structure.
static void addReferencesFromStmtSet(isl::set Set, static void addReferencesFromStmtSet(isl::set Set, SubtreeReferences *UserPtr) {
struct SubtreeReferences *UserPtr) {
isl::id Id = Set.get_tuple_id(); isl::id Id = Set.get_tuple_id();
auto *Stmt = static_cast<ScopStmt *>(Id.get_user()); auto *Stmt = static_cast<ScopStmt *>(Id.get_user());
addReferencesFromStmt(Stmt, UserPtr); addReferencesFromStmt(Stmt, UserPtr);
@ -304,9 +303,8 @@ static void addReferencesFromStmtSet(isl::set Set,
/// @param References The SubtreeReferences data structure through which /// @param References The SubtreeReferences data structure through which
/// results are returned and further information is /// results are returned and further information is
/// provided. /// provided.
static void static void addReferencesFromStmtUnionSet(isl::union_set USet,
addReferencesFromStmtUnionSet(isl::union_set USet, SubtreeReferences &References) {
struct SubtreeReferences &References) {
for (isl::set Set : USet.get_set_list()) for (isl::set Set : USet.get_set_list())
addReferencesFromStmtSet(Set, &References); addReferencesFromStmtSet(Set, &References);
@ -321,7 +319,7 @@ void IslNodeBuilder::getReferencesInSubtree(const isl::ast_node &For,
SetVector<Value *> &Values, SetVector<Value *> &Values,
SetVector<const Loop *> &Loops) { SetVector<const Loop *> &Loops) {
SetVector<const SCEV *> SCEVs; SetVector<const SCEV *> SCEVs;
struct SubtreeReferences References = { SubtreeReferences References = {
LI, SE, S, ValueMap, Values, SCEVs, getBlockGenerator(), nullptr}; LI, SE, S, ValueMap, Values, SCEVs, getBlockGenerator(), nullptr};
for (const auto &I : IDToValue) for (const auto &I : IDToValue)

View File

@ -348,7 +348,7 @@ static void replaceAllUsesAndConstantUses(Value *Old, Value *New,
rewriteOldValToNew(I, Old, New, Builder); rewriteOldValToNew(I, Old, New, Builder);
} }
class ManagedMemoryRewritePass : public ModulePass { class ManagedMemoryRewritePass final : public ModulePass {
public: public:
static char ID; static char ID;
GPUArch Architecture; GPUArch Architecture;

View File

@ -346,7 +346,7 @@ static int computeSizeInBytes(const Type *T) {
/// for generating GPU specific user nodes. /// for generating GPU specific user nodes.
/// ///
/// @see GPUNodeBuilder::createUser /// @see GPUNodeBuilder::createUser
class GPUNodeBuilder : public IslNodeBuilder { class GPUNodeBuilder final : public IslNodeBuilder {
public: public:
GPUNodeBuilder(PollyIRBuilder &Builder, ScopAnnotator &Annotator, GPUNodeBuilder(PollyIRBuilder &Builder, ScopAnnotator &Annotator,
const DataLayout &DL, LoopInfo &LI, ScalarEvolution &SE, const DataLayout &DL, LoopInfo &LI, ScalarEvolution &SE,
@ -409,7 +409,7 @@ private:
GPUArch Arch; GPUArch Arch;
/// Class to free isl_ids. /// Class to free isl_ids.
class IslIdDeleter { class IslIdDeleter final {
public: public:
void operator()(__isl_take isl_id *Id) { isl_id_free(Id); }; void operator()(__isl_take isl_id *Id) { isl_id_free(Id); };
}; };
@ -2558,7 +2558,7 @@ alignPwAffs(const std::vector<__isl_take isl_pw_aff *> &&PwAffs,
} }
namespace { namespace {
class PPCGCodeGeneration : public ScopPass { class PPCGCodeGeneration final : public ScopPass {
public: public:
static char ID; static char ID;

View File

@ -51,7 +51,8 @@ static cl::opt<std::string>
cl::Hidden, cl::value_desc("File postfix"), cl::ValueRequired, cl::Hidden, cl::value_desc("File postfix"), cl::ValueRequired,
cl::init(""), cl::cat(PollyCategory)); cl::init(""), cl::cat(PollyCategory));
struct JSONExporter : public ScopPass { class JSONExporter : public ScopPass {
public:
static char ID; static char ID;
explicit JSONExporter() : ScopPass(ID) {} explicit JSONExporter() : ScopPass(ID) {}
@ -65,7 +66,8 @@ struct JSONExporter : public ScopPass {
void getAnalysisUsage(AnalysisUsage &AU) const override; void getAnalysisUsage(AnalysisUsage &AU) const override;
}; };
struct JSONImporter : public ScopPass { class JSONImporter : public ScopPass {
public:
static char ID; static char ID;
std::vector<std::string> NewAccessStrings; std::vector<std::string> NewAccessStrings;
explicit JSONImporter() : ScopPass(ID) {} explicit JSONImporter() : ScopPass(ID) {}
@ -838,7 +840,7 @@ INITIALIZE_PASS_END(JSONImporter, "polly-import-jscop",
namespace { namespace {
/// Print result from JSONImporter. /// Print result from JSONImporter.
class JSONImporterPrinterLegacyPass : public ScopPass { class JSONImporterPrinterLegacyPass final : public ScopPass {
public: public:
static char ID; static char ID;

View File

@ -82,7 +82,7 @@ static void runDumpFunction(llvm::Function &F, StringRef Suffix) {
LLVM_DEBUG(dbgs() << "Dump file " << Dumpfile << " written successfully\n"); LLVM_DEBUG(dbgs() << "Dump file " << Dumpfile << " written successfully\n");
} }
class DumpFunctionWrapperPass : public FunctionPass { class DumpFunctionWrapperPass final : public FunctionPass {
private: private:
DumpFunctionWrapperPass(const DumpFunctionWrapperPass &) = delete; DumpFunctionWrapperPass(const DumpFunctionWrapperPass &) = delete;
const DumpFunctionWrapperPass & const DumpFunctionWrapperPass &

View File

@ -48,7 +48,7 @@ static void runDumpModule(llvm::Module &M, StringRef Filename, bool IsSuffix) {
Out->keep(); Out->keep();
} }
class DumpModuleWrapperPass : public ModulePass { class DumpModuleWrapperPass final : public ModulePass {
private: private:
DumpModuleWrapperPass(const DumpModuleWrapperPass &) = delete; DumpModuleWrapperPass(const DumpModuleWrapperPass &) = delete;
const DumpModuleWrapperPass & const DumpModuleWrapperPass &

View File

@ -234,8 +234,7 @@ namespace {
/// We use the constructor of a statically declared object to initialize the /// We use the constructor of a statically declared object to initialize the
/// different Polly passes right after the Polly library is loaded. This ensures /// different Polly passes right after the Polly library is loaded. This ensures
/// that the Polly passes are available e.g. in the 'opt' tool. /// that the Polly passes are available e.g. in the 'opt' tool.
class StaticInitializer { struct StaticInitializer {
public:
StaticInitializer() { StaticInitializer() {
llvm::PassRegistry &Registry = *llvm::PassRegistry::getPassRegistry(); llvm::PassRegistry &Registry = *llvm::PassRegistry::getPassRegistry();
polly::initializePollyPasses(Registry); polly::initializePollyPasses(Registry);

View File

@ -35,7 +35,7 @@ enum TYPE {
} // namespace SCEVType } // namespace SCEVType
/// The result the validator returns for a SCEV expression. /// The result the validator returns for a SCEV expression.
class ValidatorResult { class ValidatorResult final {
/// The type of the expression /// The type of the expression
SCEVType::TYPE Type; SCEVType::TYPE Type;
@ -112,14 +112,13 @@ public:
} }
}; };
raw_ostream &operator<<(raw_ostream &OS, class ValidatorResult &VR) { raw_ostream &operator<<(raw_ostream &OS, ValidatorResult &VR) {
VR.print(OS); VR.print(OS);
return OS; return OS;
} }
/// Check if a SCEV is valid in a SCoP. /// Check if a SCEV is valid in a SCoP.
struct SCEVValidator class SCEVValidator : public SCEVVisitor<SCEVValidator, ValidatorResult> {
: public SCEVVisitor<SCEVValidator, class ValidatorResult> {
private: private:
const Region *R; const Region *R;
Loop *Scope; Loop *Scope;
@ -131,12 +130,12 @@ public:
InvariantLoadsSetTy *ILS) InvariantLoadsSetTy *ILS)
: R(R), Scope(Scope), SE(SE), ILS(ILS) {} : R(R), Scope(Scope), SE(SE), ILS(ILS) {}
class ValidatorResult visitConstant(const SCEVConstant *Constant) { ValidatorResult visitConstant(const SCEVConstant *Constant) {
return ValidatorResult(SCEVType::INT); return ValidatorResult(SCEVType::INT);
} }
class ValidatorResult visitZeroExtendOrTruncateExpr(const SCEV *Expr, ValidatorResult visitZeroExtendOrTruncateExpr(const SCEV *Expr,
const SCEV *Operand) { const SCEV *Operand) {
ValidatorResult Op = visit(Operand); ValidatorResult Op = visit(Operand);
auto Type = Op.getType(); auto Type = Op.getType();
@ -150,23 +149,23 @@ public:
return ValidatorResult(SCEVType::PARAM, Expr); return ValidatorResult(SCEVType::PARAM, Expr);
} }
class ValidatorResult visitPtrToIntExpr(const SCEVPtrToIntExpr *Expr) { ValidatorResult visitPtrToIntExpr(const SCEVPtrToIntExpr *Expr) {
return visit(Expr->getOperand()); return visit(Expr->getOperand());
} }
class ValidatorResult visitTruncateExpr(const SCEVTruncateExpr *Expr) { ValidatorResult visitTruncateExpr(const SCEVTruncateExpr *Expr) {
return visitZeroExtendOrTruncateExpr(Expr, Expr->getOperand()); return visitZeroExtendOrTruncateExpr(Expr, Expr->getOperand());
} }
class ValidatorResult visitZeroExtendExpr(const SCEVZeroExtendExpr *Expr) { ValidatorResult visitZeroExtendExpr(const SCEVZeroExtendExpr *Expr) {
return visitZeroExtendOrTruncateExpr(Expr, Expr->getOperand()); return visitZeroExtendOrTruncateExpr(Expr, Expr->getOperand());
} }
class ValidatorResult visitSignExtendExpr(const SCEVSignExtendExpr *Expr) { ValidatorResult visitSignExtendExpr(const SCEVSignExtendExpr *Expr) {
return visit(Expr->getOperand()); return visit(Expr->getOperand());
} }
class ValidatorResult visitAddExpr(const SCEVAddExpr *Expr) { ValidatorResult visitAddExpr(const SCEVAddExpr *Expr) {
ValidatorResult Return(SCEVType::INT); ValidatorResult Return(SCEVType::INT);
for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) { for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@ -181,7 +180,7 @@ public:
return Return; return Return;
} }
class ValidatorResult visitMulExpr(const SCEVMulExpr *Expr) { ValidatorResult visitMulExpr(const SCEVMulExpr *Expr) {
ValidatorResult Return(SCEVType::INT); ValidatorResult Return(SCEVType::INT);
bool HasMultipleParams = false; bool HasMultipleParams = false;
@ -217,7 +216,7 @@ public:
return Return; return Return;
} }
class ValidatorResult visitAddRecExpr(const SCEVAddRecExpr *Expr) { ValidatorResult visitAddRecExpr(const SCEVAddRecExpr *Expr) {
if (!Expr->isAffine()) { if (!Expr->isAffine()) {
LLVM_DEBUG(dbgs() << "INVALID: AddRec is not affine"); LLVM_DEBUG(dbgs() << "INVALID: AddRec is not affine");
return ValidatorResult(SCEVType::INVALID); return ValidatorResult(SCEVType::INVALID);
@ -272,7 +271,7 @@ public:
return ZeroStartResult; return ZeroStartResult;
} }
class ValidatorResult visitSMaxExpr(const SCEVSMaxExpr *Expr) { ValidatorResult visitSMaxExpr(const SCEVSMaxExpr *Expr) {
ValidatorResult Return(SCEVType::INT); ValidatorResult Return(SCEVType::INT);
for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) { for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@ -287,7 +286,7 @@ public:
return Return; return Return;
} }
class ValidatorResult visitSMinExpr(const SCEVSMinExpr *Expr) { ValidatorResult visitSMinExpr(const SCEVSMinExpr *Expr) {
ValidatorResult Return(SCEVType::INT); ValidatorResult Return(SCEVType::INT);
for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) { for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@ -302,7 +301,7 @@ public:
return Return; return Return;
} }
class ValidatorResult visitUMaxExpr(const SCEVUMaxExpr *Expr) { ValidatorResult visitUMaxExpr(const SCEVUMaxExpr *Expr) {
// We do not support unsigned max operations. If 'Expr' is constant during // We do not support unsigned max operations. If 'Expr' is constant during
// Scop execution we treat this as a parameter, otherwise we bail out. // Scop execution we treat this as a parameter, otherwise we bail out.
for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) { for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@ -317,7 +316,7 @@ public:
return ValidatorResult(SCEVType::PARAM, Expr); return ValidatorResult(SCEVType::PARAM, Expr);
} }
class ValidatorResult visitUMinExpr(const SCEVUMinExpr *Expr) { ValidatorResult visitUMinExpr(const SCEVUMinExpr *Expr) {
// We do not support unsigned min operations. If 'Expr' is constant during // We do not support unsigned min operations. If 'Expr' is constant during
// Scop execution we treat this as a parameter, otherwise we bail out. // Scop execution we treat this as a parameter, otherwise we bail out.
for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) { for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@ -332,8 +331,7 @@ public:
return ValidatorResult(SCEVType::PARAM, Expr); return ValidatorResult(SCEVType::PARAM, Expr);
} }
class ValidatorResult ValidatorResult visitSequentialUMinExpr(const SCEVSequentialUMinExpr *Expr) {
visitSequentialUMinExpr(const SCEVSequentialUMinExpr *Expr) {
// We do not support unsigned min operations. If 'Expr' is constant during // We do not support unsigned min operations. If 'Expr' is constant during
// Scop execution we treat this as a parameter, otherwise we bail out. // Scop execution we treat this as a parameter, otherwise we bail out.
for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) { for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
@ -464,7 +462,7 @@ public:
}; };
/// Check whether a SCEV refers to an SSA name defined inside a region. /// Check whether a SCEV refers to an SSA name defined inside a region.
class SCEVInRegionDependences { class SCEVInRegionDependences final {
const Region *R; const Region *R;
Loop *Scope; Loop *Scope;
const InvariantLoadsSetTy &ILS; const InvariantLoadsSetTy &ILS;
@ -520,7 +518,7 @@ public:
}; };
/// Find all loops referenced in SCEVAddRecExprs. /// Find all loops referenced in SCEVAddRecExprs.
class SCEVFindLoops { class SCEVFindLoops final {
SetVector<const Loop *> &Loops; SetVector<const Loop *> &Loops;
public: public:
@ -541,7 +539,7 @@ void polly::findLoops(const SCEV *Expr, SetVector<const Loop *> &Loops) {
} }
/// Find all values referenced in SCEVUnknowns. /// Find all values referenced in SCEVUnknowns.
class SCEVFindValues { class SCEVFindValues final {
ScalarEvolution &SE; ScalarEvolution &SE;
SetVector<Value *> &Values; SetVector<Value *> &Values;

View File

@ -233,7 +233,7 @@ void polly::recordAssumption(polly::RecordedAssumptionsTy *RecordedAssumptions,
/// and we generate code outside/in front of that region. Hence, we generate the /// and we generate code outside/in front of that region. Hence, we generate the
/// code for the SDiv/SRem operands in front of the analyzed region and then /// code for the SDiv/SRem operands in front of the analyzed region and then
/// create a new SDiv/SRem operation there too. /// create a new SDiv/SRem operation there too.
struct ScopExpander : SCEVVisitor<ScopExpander, const SCEV *> { struct ScopExpander final : SCEVVisitor<ScopExpander, const SCEV *> {
friend struct SCEVVisitor<ScopExpander, const SCEV *>; friend struct SCEVVisitor<ScopExpander, const SCEV *>;
explicit ScopExpander(const Region &R, ScalarEvolution &SE, explicit ScopExpander(const Region &R, ScalarEvolution &SE,

View File

@ -132,7 +132,7 @@ polly::buildCanonicalicationPassesForNPM(llvm::ModulePassManager &MPM,
} }
namespace { namespace {
class PollyCanonicalize : public ModulePass { class PollyCanonicalize final : public ModulePass {
PollyCanonicalize(const PollyCanonicalize &) = delete; PollyCanonicalize(const PollyCanonicalize &) = delete;
const PollyCanonicalize &operator=(const PollyCanonicalize &) = delete; const PollyCanonicalize &operator=(const PollyCanonicalize &) = delete;

View File

@ -31,7 +31,7 @@ namespace {
/// Prepare the IR for the scop detection. /// Prepare the IR for the scop detection.
/// ///
class CodePreparation : public FunctionPass { class CodePreparation final : public FunctionPass {
CodePreparation(const CodePreparation &) = delete; CodePreparation(const CodePreparation &) = delete;
const CodePreparation &operator=(const CodePreparation &) = delete; const CodePreparation &operator=(const CodePreparation &) = delete;

View File

@ -183,7 +183,7 @@ isl::union_map expandMapping(isl::union_map Relevant, isl::union_set Universe) {
/// conflict, but overwrite values that might still be required. Another source /// conflict, but overwrite values that might still be required. Another source
/// of problems are multiple writes to the same element at the same timepoint, /// of problems are multiple writes to the same element at the same timepoint,
/// because their order is undefined. /// because their order is undefined.
class Knowledge { class Knowledge final {
private: private:
/// { [Element[] -> Zone[]] } /// { [Element[] -> Zone[]] }
/// Set of array elements and when they are alive. /// Set of array elements and when they are alive.
@ -520,7 +520,7 @@ public:
}; };
/// Implementation of the DeLICM/DePRE transformation. /// Implementation of the DeLICM/DePRE transformation.
class DeLICMImpl : public ZoneAlgorithm { class DeLICMImpl final : public ZoneAlgorithm {
private: private:
/// Knowledge before any transformation took place. /// Knowledge before any transformation took place.
Knowledge OriginalZone; Knowledge OriginalZone;
@ -1416,7 +1416,7 @@ static PreservedAnalyses runDeLICMUsingNPM(Scop &S, ScopAnalysisManager &SAM,
return PA; return PA;
} }
class DeLICMWrapperPass : public ScopPass { class DeLICMWrapperPass final : public ScopPass {
private: private:
DeLICMWrapperPass(const DeLICMWrapperPass &) = delete; DeLICMWrapperPass(const DeLICMWrapperPass &) = delete;
const DeLICMWrapperPass &operator=(const DeLICMWrapperPass &) = delete; const DeLICMWrapperPass &operator=(const DeLICMWrapperPass &) = delete;
@ -1459,7 +1459,7 @@ public:
char DeLICMWrapperPass::ID; char DeLICMWrapperPass::ID;
/// Print result from DeLICMWrapperPass. /// Print result from DeLICMWrapperPass.
class DeLICMPrinterLegacyPass : public ScopPass { class DeLICMPrinterLegacyPass final : public ScopPass {
public: public:
static char ID; static char ID;

View File

@ -51,7 +51,7 @@ cl::opt<int> DCEPreciseSteps(
"before the actual dead code elimination."), "before the actual dead code elimination."),
cl::ZeroOrMore, cl::init(-1), cl::cat(PollyCategory)); cl::ZeroOrMore, cl::init(-1), cl::cat(PollyCategory));
class DeadCodeElimWrapperPass : public ScopPass { class DeadCodeElimWrapperPass final : public ScopPass {
public: public:
static char ID; static char ID;
explicit DeadCodeElimWrapperPass() : ScopPass(ID) {} explicit DeadCodeElimWrapperPass() : ScopPass(ID) {}

View File

@ -35,7 +35,7 @@ void printSchedule(raw_ostream &OS, const isl::union_map &Schedule,
} }
/// Flatten the schedule stored in an polly::Scop. /// Flatten the schedule stored in an polly::Scop.
class FlattenSchedule : public ScopPass { class FlattenSchedule final : public ScopPass {
private: private:
FlattenSchedule(const FlattenSchedule &) = delete; FlattenSchedule(const FlattenSchedule &) = delete;
const FlattenSchedule &operator=(const FlattenSchedule &) = delete; const FlattenSchedule &operator=(const FlattenSchedule &) = delete;
@ -98,7 +98,7 @@ public:
char FlattenSchedule::ID; char FlattenSchedule::ID;
/// Print result from FlattenSchedule. /// Print result from FlattenSchedule.
class FlattenSchedulePrinterLegacyPass : public ScopPass { class FlattenSchedulePrinterLegacyPass final : public ScopPass {
public: public:
static char ID; static char ID;

View File

@ -197,7 +197,7 @@ struct ForwardingAction {
/// the MemoryAccess is removed and the all the operand tree instructions are /// the MemoryAccess is removed and the all the operand tree instructions are
/// moved into the statement. All original instructions are left in the source /// moved into the statement. All original instructions are left in the source
/// statements. The simplification pass can clean these up. /// statements. The simplification pass can clean these up.
class ForwardOpTreeImpl : ZoneAlgorithm { class ForwardOpTreeImpl final : ZoneAlgorithm {
private: private:
using MemoizationTy = DenseMap<ForwardingAction::KeyTy, ForwardingAction>; using MemoizationTy = DenseMap<ForwardingAction::KeyTy, ForwardingAction>;
@ -1101,7 +1101,7 @@ runForwardOpTreeUsingNPM(Scop &S, ScopAnalysisManager &SAM,
/// scalar definition are redirected (We currently do not care about removing /// scalar definition are redirected (We currently do not care about removing
/// the write in this case). This is also useful for the main DeLICM pass as /// the write in this case). This is also useful for the main DeLICM pass as
/// there are less scalars to be mapped. /// there are less scalars to be mapped.
class ForwardOpTreeWrapperPass : public ScopPass { class ForwardOpTreeWrapperPass final : public ScopPass {
private: private:
/// The pass implementation, also holding per-scop data. /// The pass implementation, also holding per-scop data.
std::unique_ptr<ForwardOpTreeImpl> Impl; std::unique_ptr<ForwardOpTreeImpl> Impl;
@ -1145,7 +1145,7 @@ public:
char ForwardOpTreeWrapperPass::ID; char ForwardOpTreeWrapperPass::ID;
/// Print result from ForwardOpTreeWrapperPass. /// Print result from ForwardOpTreeWrapperPass.
class ForwardOpTreePrinterLegacyPass : public ScopPass { class ForwardOpTreePrinterLegacyPass final : public ScopPass {
public: public:
static char ID; static char ID;

View File

@ -132,7 +132,7 @@ static auto getLoopMDProps(MDNode *LoopMD) {
/// Recursively visit all nodes in a schedule, loop for loop-transformations /// Recursively visit all nodes in a schedule, loop for loop-transformations
/// metadata and apply the first encountered. /// metadata and apply the first encountered.
class SearchTransformVisitor class SearchTransformVisitor final
: public RecursiveScheduleTreeVisitor<SearchTransformVisitor> { : public RecursiveScheduleTreeVisitor<SearchTransformVisitor> {
private: private:
using BaseTy = RecursiveScheduleTreeVisitor<SearchTransformVisitor>; using BaseTy = RecursiveScheduleTreeVisitor<SearchTransformVisitor>;

View File

@ -539,8 +539,8 @@ static uint64_t getMatMulTypeSize(MatMulInfoTy MMI) {
/// @param MMI Parameters of the matrix multiplication operands. /// @param MMI Parameters of the matrix multiplication operands.
/// @return The structure of type MicroKernelParamsTy. /// @return The structure of type MicroKernelParamsTy.
/// @see MicroKernelParamsTy /// @see MicroKernelParamsTy
static struct MicroKernelParamsTy static MicroKernelParamsTy getMicroKernelParams(const TargetTransformInfo *TTI,
getMicroKernelParams(const TargetTransformInfo *TTI, MatMulInfoTy MMI) { MatMulInfoTy MMI) {
assert(TTI && "The target transform info should be provided."); assert(TTI && "The target transform info should be provided.");
// Nvec - Number of double-precision floating-point numbers that can be hold // Nvec - Number of double-precision floating-point numbers that can be hold
@ -614,7 +614,7 @@ static void getTargetCacheParameters(const llvm::TargetTransformInfo *TTI) {
/// @return The structure of type MacroKernelParamsTy. /// @return The structure of type MacroKernelParamsTy.
/// @see MacroKernelParamsTy /// @see MacroKernelParamsTy
/// @see MicroKernelParamsTy /// @see MicroKernelParamsTy
static struct MacroKernelParamsTy static MacroKernelParamsTy
getMacroKernelParams(const llvm::TargetTransformInfo *TTI, getMacroKernelParams(const llvm::TargetTransformInfo *TTI,
const MicroKernelParamsTy &MicroKernelParams, const MicroKernelParamsTy &MicroKernelParams,
MatMulInfoTy MMI) { MatMulInfoTy MMI) {
@ -893,7 +893,7 @@ getInductionVariablesSubstitution(isl::schedule_node Node,
/// @return The modified isl_schedule_node. /// @return The modified isl_schedule_node.
static isl::schedule_node static isl::schedule_node
isolateAndUnrollMatMulInnerLoops(isl::schedule_node Node, isolateAndUnrollMatMulInnerLoops(isl::schedule_node Node,
struct MicroKernelParamsTy MicroKernelParams) { MicroKernelParamsTy MicroKernelParams) {
isl::schedule_node Child = Node.child(0); isl::schedule_node Child = Node.child(0);
isl::union_map UnMapOldIndVar = Child.get_prefix_schedule_relation(); isl::union_map UnMapOldIndVar = Child.get_prefix_schedule_relation();
isl::set Prefix = isl::map::from_union_map(UnMapOldIndVar).range(); isl::set Prefix = isl::map::from_union_map(UnMapOldIndVar).range();

View File

@ -34,7 +34,7 @@ using namespace polly;
namespace { namespace {
class MaximalStaticExpander : public ScopPass { class MaximalStaticExpander final : public ScopPass {
public: public:
static char ID; static char ID;

View File

@ -237,7 +237,7 @@ struct OptimizerAdditionalInfoTy {
bool Prevect; bool Prevect;
}; };
class ScheduleTreeOptimizer { class ScheduleTreeOptimizer final {
public: public:
/// Apply schedule tree transformations. /// Apply schedule tree transformations.
/// ///
@ -384,7 +384,7 @@ ScheduleTreeOptimizer::isolateFullPartialTiles(isl::schedule_node Node,
return Result; return Result;
} }
struct InsertSimdMarkers : public ScheduleNodeRewriter<InsertSimdMarkers> { struct InsertSimdMarkers final : ScheduleNodeRewriter<InsertSimdMarkers> {
isl::schedule_node visitBand(isl::schedule_node_band Band) { isl::schedule_node visitBand(isl::schedule_node_band Band) {
isl::schedule_node Node = visitChildren(Band); isl::schedule_node Node = visitChildren(Band);
@ -588,7 +588,7 @@ bool ScheduleTreeOptimizer::isProfitableSchedule(Scop &S,
return changed; return changed;
} }
class IslScheduleOptimizerWrapperPass : public ScopPass { class IslScheduleOptimizerWrapperPass final : public ScopPass {
public: public:
static char ID; static char ID;
@ -1013,7 +1013,7 @@ IslScheduleOptimizerPrinterPass::run(Scop &S, ScopAnalysisManager &SAM,
namespace { namespace {
/// Print result from IslScheduleOptimizerWrapperPass. /// Print result from IslScheduleOptimizerWrapperPass.
class IslScheduleOptimizerPrinterLegacyPass : public ScopPass { class IslScheduleOptimizerPrinterLegacyPass final : public ScopPass {
public: public:
static char ID; static char ID;

View File

@ -128,7 +128,7 @@ static isl::schedule rebuildBand(isl::schedule_node_band OldBand,
/// AST build options must be set after the tree has been constructed. /// AST build options must be set after the tree has been constructed.
template <typename Derived, typename... Args> template <typename Derived, typename... Args>
struct ScheduleTreeRewriter struct ScheduleTreeRewriter
: public RecursiveScheduleTreeVisitor<Derived, isl::schedule, Args...> { : RecursiveScheduleTreeVisitor<Derived, isl::schedule, Args...> {
Derived &getDerived() { return *static_cast<Derived *>(this); } Derived &getDerived() { return *static_cast<Derived *>(this); }
const Derived &getDerived() const { const Derived &getDerived() const {
return *static_cast<const Derived *>(this); return *static_cast<const Derived *>(this);
@ -212,7 +212,7 @@ struct ScheduleTreeRewriter
/// Rewrite the schedule tree without any changes. Useful to copy a subtree into /// Rewrite the schedule tree without any changes. Useful to copy a subtree into
/// a new schedule, discarding everything but. /// a new schedule, discarding everything but.
struct IdentityRewriter : public ScheduleTreeRewriter<IdentityRewriter> {}; struct IdentityRewriter : ScheduleTreeRewriter<IdentityRewriter> {};
/// Rewrite a schedule tree to an equivalent one without extension nodes. /// Rewrite a schedule tree to an equivalent one without extension nodes.
/// ///
@ -225,9 +225,9 @@ struct IdentityRewriter : public ScheduleTreeRewriter<IdentityRewriter> {};
/// band nodes to schedule the additional domains at the same position as the /// band nodes to schedule the additional domains at the same position as the
/// extension node would. /// extension node would.
/// ///
struct ExtensionNodeRewriter struct ExtensionNodeRewriter final
: public ScheduleTreeRewriter<ExtensionNodeRewriter, const isl::union_set &, : ScheduleTreeRewriter<ExtensionNodeRewriter, const isl::union_set &,
isl::union_map &> { isl::union_map &> {
using BaseTy = ScheduleTreeRewriter<ExtensionNodeRewriter, using BaseTy = ScheduleTreeRewriter<ExtensionNodeRewriter,
const isl::union_set &, isl::union_map &>; const isl::union_set &, isl::union_map &>;
BaseTy &getBase() { return *this; } BaseTy &getBase() { return *this; }
@ -356,8 +356,8 @@ struct ExtensionNodeRewriter
/// ///
/// ScheduleTreeRewriter cannot apply the schedule tree options. This class /// ScheduleTreeRewriter cannot apply the schedule tree options. This class
/// collects these options to apply them later. /// collects these options to apply them later.
struct CollectASTBuildOptions struct CollectASTBuildOptions final
: public RecursiveScheduleTreeVisitor<CollectASTBuildOptions> { : RecursiveScheduleTreeVisitor<CollectASTBuildOptions> {
using BaseTy = RecursiveScheduleTreeVisitor<CollectASTBuildOptions>; using BaseTy = RecursiveScheduleTreeVisitor<CollectASTBuildOptions>;
BaseTy &getBase() { return *this; } BaseTy &getBase() { return *this; }
const BaseTy &getBase() const { return *this; } const BaseTy &getBase() const { return *this; }
@ -376,8 +376,7 @@ struct CollectASTBuildOptions
/// This rewrites a schedule tree with the AST build options applied. We assume /// This rewrites a schedule tree with the AST build options applied. We assume
/// that the band nodes are visited in the same order as they were when the /// that the band nodes are visited in the same order as they were when the
/// build options were collected, typically by CollectASTBuildOptions. /// build options were collected, typically by CollectASTBuildOptions.
struct ApplyASTBuildOptions struct ApplyASTBuildOptions final : ScheduleNodeRewriter<ApplyASTBuildOptions> {
: public ScheduleNodeRewriter<ApplyASTBuildOptions> {
using BaseTy = ScheduleNodeRewriter<ApplyASTBuildOptions>; using BaseTy = ScheduleNodeRewriter<ApplyASTBuildOptions>;
BaseTy &getBase() { return *this; } BaseTy &getBase() { return *this; }
const BaseTy &getBase() const { return *this; } const BaseTy &getBase() const { return *this; }
@ -560,7 +559,8 @@ static isl::set addExtentConstraints(isl::set Set, int VectorWidth) {
} }
/// Collapse perfectly nested bands into a single band. /// Collapse perfectly nested bands into a single band.
class BandCollapseRewriter : public ScheduleTreeRewriter<BandCollapseRewriter> { class BandCollapseRewriter final
: public ScheduleTreeRewriter<BandCollapseRewriter> {
private: private:
using BaseTy = ScheduleTreeRewriter<BandCollapseRewriter>; using BaseTy = ScheduleTreeRewriter<BandCollapseRewriter>;
BaseTy &getBase() { return *this; } BaseTy &getBase() { return *this; }
@ -833,7 +833,7 @@ static isl::schedule tryGreedyFuse(isl::schedule_node LHS,
/// ///
/// The isl::union_map parameters is the set of validity dependencies that have /// The isl::union_map parameters is the set of validity dependencies that have
/// not been resolved/carried by a parent schedule node. /// not been resolved/carried by a parent schedule node.
class GreedyFusionRewriter class GreedyFusionRewriter final
: public ScheduleTreeRewriter<GreedyFusionRewriter, isl::union_map> { : public ScheduleTreeRewriter<GreedyFusionRewriter, isl::union_map> {
private: private:
using BaseTy = ScheduleTreeRewriter<GreedyFusionRewriter, isl::union_map>; using BaseTy = ScheduleTreeRewriter<GreedyFusionRewriter, isl::union_map>;

View File

@ -27,7 +27,7 @@ using namespace llvm;
using namespace polly; using namespace polly;
namespace { namespace {
class ScopInliner : public CallGraphSCCPass { class ScopInliner final : public CallGraphSCCPass {
using llvm::Pass::doInitialization; using llvm::Pass::doInitialization;
public: public:

View File

@ -119,7 +119,7 @@ static isl::union_map underapproximatedAddMap(isl::union_map UMap,
return UResult; return UResult;
} }
class SimplifyImpl { class SimplifyImpl final {
private: private:
/// The invocation id (if there are multiple instances in the pass manager's /// The invocation id (if there are multiple instances in the pass manager's
/// pipeline) to determine which statistics to update. /// pipeline) to determine which statistics to update.
@ -754,7 +754,7 @@ void SimplifyImpl::printScop(raw_ostream &OS, Scop &S) const {
printAccesses(OS); printAccesses(OS);
} }
class SimplifyWrapperPass : public ScopPass { class SimplifyWrapperPass final : public ScopPass {
public: public:
static char ID; static char ID;
int CallNo; int CallNo;
@ -855,7 +855,7 @@ INITIALIZE_PASS_END(SimplifyWrapperPass, "polly-simplify", "Polly - Simplify",
namespace { namespace {
/// Print result from SimplifyWrapperPass. /// Print result from SimplifyWrapperPass.
class SimplifyPrinterLegacyPass : public ScopPass { class SimplifyPrinterLegacyPass final : public ScopPass {
public: public:
static char ID; static char ID;