#ifdef GEN_PASS_DECL
#define GEN_PASS_DECL_SCFBUFFERIZE
#define GEN_PASS_DECL_SCFFORLOOPCANONICALIZATION
#define GEN_PASS_DECL_SCFFORLOOPPEELING
#define GEN_PASS_DECL_SCFFORLOOPRANGEFOLDING
#define GEN_PASS_DECL_SCFFORLOOPSPECIALIZATION
#define GEN_PASS_DECL_SCFFORTOWHILELOOP
#define GEN_PASS_DECL_SCFFORALLTOFORLOOP
#define GEN_PASS_DECL_SCFFORALLTOPARALLELLOOP
#define GEN_PASS_DECL_SCFPARALLELLOOPFUSION
#define GEN_PASS_DECL_SCFPARALLELLOOPSPECIALIZATION
#define GEN_PASS_DECL_SCFPARALLELLOOPTILING
#define GEN_PASS_DECL_TESTSCFPARALLELLOOPCOLLAPSING
#undef GEN_PASS_DECL
#endif
#ifdef GEN_PASS_DECL_SCFBUFFERIZE
#undef GEN_PASS_DECL_SCFBUFFERIZE
#endif
#ifdef GEN_PASS_DEF_SCFBUFFERIZE
namespace impl {
template <typename DerivedT>
class SCFBufferizeBase : public ::mlir::OperationPass<> {
public:
using Base = SCFBufferizeBase;
SCFBufferizeBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFBufferizeBase(const SCFBufferizeBase &other) : ::mlir::OperationPass<>(other) {}
SCFBufferizeBase& operator=(const SCFBufferizeBase &) = delete;
SCFBufferizeBase(SCFBufferizeBase &&) = delete;
SCFBufferizeBase& operator=(SCFBufferizeBase &&) = delete;
~SCFBufferizeBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-bufferize");
}
::llvm::StringRef getArgument() const override { return "scf-bufferize"; }
::llvm::StringRef getDescription() const override { return "Bufferize the scf dialect."; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFBufferize");
}
::llvm::StringRef getName() const override { return "SCFBufferize"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
registry.insert<bufferization::BufferizationDialect>();
registry.insert<memref::MemRefDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFBufferizeBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_SCFBUFFERIZE
#endif
#ifdef GEN_PASS_DECL_SCFFORLOOPCANONICALIZATION
#undef GEN_PASS_DECL_SCFFORLOOPCANONICALIZATION
#endif
#ifdef GEN_PASS_DEF_SCFFORLOOPCANONICALIZATION
namespace impl {
template <typename DerivedT>
class SCFForLoopCanonicalizationBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForLoopCanonicalizationBase;
SCFForLoopCanonicalizationBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForLoopCanonicalizationBase(const SCFForLoopCanonicalizationBase &other) : ::mlir::OperationPass<>(other) {}
SCFForLoopCanonicalizationBase& operator=(const SCFForLoopCanonicalizationBase &) = delete;
SCFForLoopCanonicalizationBase(SCFForLoopCanonicalizationBase &&) = delete;
SCFForLoopCanonicalizationBase& operator=(SCFForLoopCanonicalizationBase &&) = delete;
~SCFForLoopCanonicalizationBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-for-loop-canonicalization");
}
::llvm::StringRef getArgument() const override { return "scf-for-loop-canonicalization"; }
::llvm::StringRef getDescription() const override { return "Canonicalize operations within scf.for loop bodies"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForLoopCanonicalization");
}
::llvm::StringRef getName() const override { return "SCFForLoopCanonicalization"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
registry.insert<affine::AffineDialect>();
registry.insert<tensor::TensorDialect>();
registry.insert<memref::MemRefDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForLoopCanonicalizationBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_SCFFORLOOPCANONICALIZATION
#endif
#ifdef GEN_PASS_DECL_SCFFORLOOPPEELING
struct SCFForLoopPeelingOptions { … };
#undef GEN_PASS_DECL_SCFFORLOOPPEELING
#endif
#ifdef GEN_PASS_DEF_SCFFORLOOPPEELING
namespace impl {
template <typename DerivedT>
class SCFForLoopPeelingBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForLoopPeelingBase;
SCFForLoopPeelingBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForLoopPeelingBase(const SCFForLoopPeelingBase &other) : ::mlir::OperationPass<>(other) {}
SCFForLoopPeelingBase& operator=(const SCFForLoopPeelingBase &) = delete;
SCFForLoopPeelingBase(SCFForLoopPeelingBase &&) = delete;
SCFForLoopPeelingBase& operator=(SCFForLoopPeelingBase &&) = delete;
~SCFForLoopPeelingBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-for-loop-peeling");
}
::llvm::StringRef getArgument() const override { return "scf-for-loop-peeling"; }
::llvm::StringRef getDescription() const override { return "Peel `for` loops at their upper bounds."; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForLoopPeeling");
}
::llvm::StringRef getName() const override { return "SCFForLoopPeeling"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
registry.insert<affine::AffineDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForLoopPeelingBase<DerivedT>)
SCFForLoopPeelingBase(SCFForLoopPeelingOptions options) : SCFForLoopPeelingBase() {
peelFront = std::move(options.peelFront);
skipPartial = std::move(options.skipPartial);
}
protected:
::mlir::Pass::Option<bool> peelFront{*this, "peel-front", ::llvm::cl::desc("Peel the first iteration out of the loop."), ::llvm::cl::init(false)};
::mlir::Pass::Option<bool> skipPartial{*this, "skip-partial", ::llvm::cl::desc("Do not peel loops inside of the last, partial iteration of another already peeled loop."), ::llvm::cl::init(true)};
private:
};
}
#undef GEN_PASS_DEF_SCFFORLOOPPEELING
#endif
#ifdef GEN_PASS_DECL_SCFFORLOOPRANGEFOLDING
#undef GEN_PASS_DECL_SCFFORLOOPRANGEFOLDING
#endif
#ifdef GEN_PASS_DEF_SCFFORLOOPRANGEFOLDING
namespace impl {
template <typename DerivedT>
class SCFForLoopRangeFoldingBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForLoopRangeFoldingBase;
SCFForLoopRangeFoldingBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForLoopRangeFoldingBase(const SCFForLoopRangeFoldingBase &other) : ::mlir::OperationPass<>(other) {}
SCFForLoopRangeFoldingBase& operator=(const SCFForLoopRangeFoldingBase &) = delete;
SCFForLoopRangeFoldingBase(SCFForLoopRangeFoldingBase &&) = delete;
SCFForLoopRangeFoldingBase& operator=(SCFForLoopRangeFoldingBase &&) = delete;
~SCFForLoopRangeFoldingBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-for-loop-range-folding");
}
::llvm::StringRef getArgument() const override { return "scf-for-loop-range-folding"; }
::llvm::StringRef getDescription() const override { return "Fold add/mul ops into loop range"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForLoopRangeFolding");
}
::llvm::StringRef getName() const override { return "SCFForLoopRangeFolding"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForLoopRangeFoldingBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_SCFFORLOOPRANGEFOLDING
#endif
#ifdef GEN_PASS_DECL_SCFFORLOOPSPECIALIZATION
#undef GEN_PASS_DECL_SCFFORLOOPSPECIALIZATION
#endif
#ifdef GEN_PASS_DEF_SCFFORLOOPSPECIALIZATION
namespace impl {
template <typename DerivedT>
class SCFForLoopSpecializationBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForLoopSpecializationBase;
SCFForLoopSpecializationBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForLoopSpecializationBase(const SCFForLoopSpecializationBase &other) : ::mlir::OperationPass<>(other) {}
SCFForLoopSpecializationBase& operator=(const SCFForLoopSpecializationBase &) = delete;
SCFForLoopSpecializationBase(SCFForLoopSpecializationBase &&) = delete;
SCFForLoopSpecializationBase& operator=(SCFForLoopSpecializationBase &&) = delete;
~SCFForLoopSpecializationBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-for-loop-specialization");
}
::llvm::StringRef getArgument() const override { return "scf-for-loop-specialization"; }
::llvm::StringRef getDescription() const override { return "Specialize `for` loops for vectorization"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForLoopSpecialization");
}
::llvm::StringRef getName() const override { return "SCFForLoopSpecialization"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForLoopSpecializationBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_SCFFORLOOPSPECIALIZATION
#endif
#ifdef GEN_PASS_DECL_SCFFORTOWHILELOOP
#undef GEN_PASS_DECL_SCFFORTOWHILELOOP
#endif
#ifdef GEN_PASS_DEF_SCFFORTOWHILELOOP
namespace impl {
template <typename DerivedT>
class SCFForToWhileLoopBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForToWhileLoopBase;
SCFForToWhileLoopBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForToWhileLoopBase(const SCFForToWhileLoopBase &other) : ::mlir::OperationPass<>(other) {}
SCFForToWhileLoopBase& operator=(const SCFForToWhileLoopBase &) = delete;
SCFForToWhileLoopBase(SCFForToWhileLoopBase &&) = delete;
SCFForToWhileLoopBase& operator=(SCFForToWhileLoopBase &&) = delete;
~SCFForToWhileLoopBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-for-to-while");
}
::llvm::StringRef getArgument() const override { return "scf-for-to-while"; }
::llvm::StringRef getDescription() const override { return "Convert SCF for loops to SCF while loops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForToWhileLoop");
}
::llvm::StringRef getName() const override { return "SCFForToWhileLoop"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForToWhileLoopBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_SCFFORTOWHILELOOP
#endif
#ifdef GEN_PASS_DECL_SCFFORALLTOFORLOOP
#undef GEN_PASS_DECL_SCFFORALLTOFORLOOP
#endif
#ifdef GEN_PASS_DEF_SCFFORALLTOFORLOOP
namespace impl {
template <typename DerivedT>
class SCFForallToForLoopBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForallToForLoopBase;
SCFForallToForLoopBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForallToForLoopBase(const SCFForallToForLoopBase &other) : ::mlir::OperationPass<>(other) {}
SCFForallToForLoopBase& operator=(const SCFForallToForLoopBase &) = delete;
SCFForallToForLoopBase(SCFForallToForLoopBase &&) = delete;
SCFForallToForLoopBase& operator=(SCFForallToForLoopBase &&) = delete;
~SCFForallToForLoopBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-forall-to-for");
}
::llvm::StringRef getArgument() const override { return "scf-forall-to-for"; }
::llvm::StringRef getDescription() const override { return "Convert SCF forall loops to SCF for loops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForallToForLoop");
}
::llvm::StringRef getName() const override { return "SCFForallToForLoop"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForallToForLoopBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_SCFFORALLTOFORLOOP
#endif
#ifdef GEN_PASS_DECL_SCFFORALLTOPARALLELLOOP
#undef GEN_PASS_DECL_SCFFORALLTOPARALLELLOOP
#endif
#ifdef GEN_PASS_DEF_SCFFORALLTOPARALLELLOOP
namespace impl {
template <typename DerivedT>
class SCFForallToParallelLoopBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForallToParallelLoopBase;
SCFForallToParallelLoopBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForallToParallelLoopBase(const SCFForallToParallelLoopBase &other) : ::mlir::OperationPass<>(other) {}
SCFForallToParallelLoopBase& operator=(const SCFForallToParallelLoopBase &) = delete;
SCFForallToParallelLoopBase(SCFForallToParallelLoopBase &&) = delete;
SCFForallToParallelLoopBase& operator=(SCFForallToParallelLoopBase &&) = delete;
~SCFForallToParallelLoopBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-forall-to-parallel");
}
::llvm::StringRef getArgument() const override { return "scf-forall-to-parallel"; }
::llvm::StringRef getDescription() const override { return "Convert SCF forall loops to SCF parallel loops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForallToParallelLoop");
}
::llvm::StringRef getName() const override { return "SCFForallToParallelLoop"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForallToParallelLoopBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_SCFFORALLTOPARALLELLOOP
#endif
#ifdef GEN_PASS_DECL_SCFPARALLELLOOPFUSION
#undef GEN_PASS_DECL_SCFPARALLELLOOPFUSION
#endif
#ifdef GEN_PASS_DEF_SCFPARALLELLOOPFUSION
namespace impl {
template <typename DerivedT>
class SCFParallelLoopFusionBase : public ::mlir::OperationPass<> {
public:
using Base = SCFParallelLoopFusionBase;
SCFParallelLoopFusionBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFParallelLoopFusionBase(const SCFParallelLoopFusionBase &other) : ::mlir::OperationPass<>(other) {}
SCFParallelLoopFusionBase& operator=(const SCFParallelLoopFusionBase &) = delete;
SCFParallelLoopFusionBase(SCFParallelLoopFusionBase &&) = delete;
SCFParallelLoopFusionBase& operator=(SCFParallelLoopFusionBase &&) = delete;
~SCFParallelLoopFusionBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-parallel-loop-fusion");
}
::llvm::StringRef getArgument() const override { return "scf-parallel-loop-fusion"; }
::llvm::StringRef getDescription() const override { return "Fuse adjacent parallel loops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFParallelLoopFusion");
}
::llvm::StringRef getName() const override { return "SCFParallelLoopFusion"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFParallelLoopFusionBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_SCFPARALLELLOOPFUSION
#endif
#ifdef GEN_PASS_DECL_SCFPARALLELLOOPSPECIALIZATION
#undef GEN_PASS_DECL_SCFPARALLELLOOPSPECIALIZATION
#endif
#ifdef GEN_PASS_DEF_SCFPARALLELLOOPSPECIALIZATION
namespace impl {
template <typename DerivedT>
class SCFParallelLoopSpecializationBase : public ::mlir::OperationPass<> {
public:
using Base = SCFParallelLoopSpecializationBase;
SCFParallelLoopSpecializationBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFParallelLoopSpecializationBase(const SCFParallelLoopSpecializationBase &other) : ::mlir::OperationPass<>(other) {}
SCFParallelLoopSpecializationBase& operator=(const SCFParallelLoopSpecializationBase &) = delete;
SCFParallelLoopSpecializationBase(SCFParallelLoopSpecializationBase &&) = delete;
SCFParallelLoopSpecializationBase& operator=(SCFParallelLoopSpecializationBase &&) = delete;
~SCFParallelLoopSpecializationBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-parallel-loop-specialization");
}
::llvm::StringRef getArgument() const override { return "scf-parallel-loop-specialization"; }
::llvm::StringRef getDescription() const override { return "Specialize parallel loops for vectorization"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFParallelLoopSpecialization");
}
::llvm::StringRef getName() const override { return "SCFParallelLoopSpecialization"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFParallelLoopSpecializationBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_SCFPARALLELLOOPSPECIALIZATION
#endif
#ifdef GEN_PASS_DECL_SCFPARALLELLOOPTILING
struct SCFParallelLoopTilingOptions { … };
#undef GEN_PASS_DECL_SCFPARALLELLOOPTILING
#endif
#ifdef GEN_PASS_DEF_SCFPARALLELLOOPTILING
namespace impl {
template <typename DerivedT>
class SCFParallelLoopTilingBase : public ::mlir::OperationPass<> {
public:
using Base = SCFParallelLoopTilingBase;
SCFParallelLoopTilingBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFParallelLoopTilingBase(const SCFParallelLoopTilingBase &other) : ::mlir::OperationPass<>(other) {}
SCFParallelLoopTilingBase& operator=(const SCFParallelLoopTilingBase &) = delete;
SCFParallelLoopTilingBase(SCFParallelLoopTilingBase &&) = delete;
SCFParallelLoopTilingBase& operator=(SCFParallelLoopTilingBase &&) = delete;
~SCFParallelLoopTilingBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-parallel-loop-tiling");
}
::llvm::StringRef getArgument() const override { return "scf-parallel-loop-tiling"; }
::llvm::StringRef getDescription() const override { return "Tile parallel loops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFParallelLoopTiling");
}
::llvm::StringRef getName() const override { return "SCFParallelLoopTiling"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
registry.insert<affine::AffineDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFParallelLoopTilingBase<DerivedT>)
SCFParallelLoopTilingBase(SCFParallelLoopTilingOptions options) : SCFParallelLoopTilingBase() {
tileSizes = std::move(options.tileSizes);
noMinMaxBounds = std::move(options.noMinMaxBounds);
}
protected:
::mlir::Pass::ListOption<int64_t> tileSizes{*this, "parallel-loop-tile-sizes", ::llvm::cl::desc("Factors to tile parallel loops by")};
::mlir::Pass::Option<bool> noMinMaxBounds{*this, "no-min-max-bounds", ::llvm::cl::desc("Perform tiling with fixed upper bound with inbound check inside the internal loops"), ::llvm::cl::init(false)};
private:
};
}
#undef GEN_PASS_DEF_SCFPARALLELLOOPTILING
#endif
#ifdef GEN_PASS_DECL_TESTSCFPARALLELLOOPCOLLAPSING
struct TestSCFParallelLoopCollapsingOptions { … };
#undef GEN_PASS_DECL_TESTSCFPARALLELLOOPCOLLAPSING
#endif
#ifdef GEN_PASS_DEF_TESTSCFPARALLELLOOPCOLLAPSING
namespace impl {
template <typename DerivedT>
class TestSCFParallelLoopCollapsingBase : public ::mlir::OperationPass<> {
public:
using Base = TestSCFParallelLoopCollapsingBase;
TestSCFParallelLoopCollapsingBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
TestSCFParallelLoopCollapsingBase(const TestSCFParallelLoopCollapsingBase &other) : ::mlir::OperationPass<>(other) {}
TestSCFParallelLoopCollapsingBase& operator=(const TestSCFParallelLoopCollapsingBase &) = delete;
TestSCFParallelLoopCollapsingBase(TestSCFParallelLoopCollapsingBase &&) = delete;
TestSCFParallelLoopCollapsingBase& operator=(TestSCFParallelLoopCollapsingBase &&) = delete;
~TestSCFParallelLoopCollapsingBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("test-scf-parallel-loop-collapsing");
}
::llvm::StringRef getArgument() const override { return "test-scf-parallel-loop-collapsing"; }
::llvm::StringRef getDescription() const override { return "Test parallel loops collapsing transformation"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("TestSCFParallelLoopCollapsing");
}
::llvm::StringRef getName() const override { return "TestSCFParallelLoopCollapsing"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
registry.insert<affine::AffineDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestSCFParallelLoopCollapsingBase<DerivedT>)
TestSCFParallelLoopCollapsingBase(TestSCFParallelLoopCollapsingOptions options) : TestSCFParallelLoopCollapsingBase() {
clCollapsedIndices0 = std::move(options.clCollapsedIndices0);
clCollapsedIndices1 = std::move(options.clCollapsedIndices1);
clCollapsedIndices2 = std::move(options.clCollapsedIndices2);
}
protected:
::mlir::Pass::ListOption<unsigned> clCollapsedIndices0{*this, "collapsed-indices-0", ::llvm::cl::desc("Which loop indices to combine 0th loop index")};
::mlir::Pass::ListOption<unsigned> clCollapsedIndices1{*this, "collapsed-indices-1", ::llvm::cl::desc("Which loop indices to combine into the position 1 loop index")};
::mlir::Pass::ListOption<unsigned> clCollapsedIndices2{*this, "collapsed-indices-2", ::llvm::cl::desc("Which loop indices to combine into the position 2 loop index")};
private:
};
}
#undef GEN_PASS_DEF_TESTSCFPARALLELLOOPCOLLAPSING
#endif
#ifdef GEN_PASS_REGISTRATION
inline void registerSCFBufferize() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createSCFBufferizePass();
});
}
inline void registerSCFBufferizePass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createSCFBufferizePass();
});
}
inline void registerSCFForLoopCanonicalization() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createSCFForLoopCanonicalizationPass();
});
}
inline void registerSCFForLoopCanonicalizationPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createSCFForLoopCanonicalizationPass();
});
}
inline void registerSCFForLoopPeeling() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForLoopPeelingPass();
});
}
inline void registerSCFForLoopPeelingPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForLoopPeelingPass();
});
}
inline void registerSCFForLoopRangeFolding() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForLoopRangeFoldingPass();
});
}
inline void registerSCFForLoopRangeFoldingPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForLoopRangeFoldingPass();
});
}
inline void registerSCFForLoopSpecialization() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForLoopSpecializationPass();
});
}
inline void registerSCFForLoopSpecializationPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForLoopSpecializationPass();
});
}
inline void registerSCFForToWhileLoop() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForToWhileLoopPass();
});
}
inline void registerSCFForToWhileLoopPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForToWhileLoopPass();
});
}
inline void registerSCFForallToForLoop() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForallToForLoopPass();
});
}
inline void registerSCFForallToForLoopPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForallToForLoopPass();
});
}
inline void registerSCFForallToParallelLoop() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForallToParallelLoopPass();
});
}
inline void registerSCFForallToParallelLoopPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createForallToParallelLoopPass();
});
}
inline void registerSCFParallelLoopFusion() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createParallelLoopFusionPass();
});
}
inline void registerSCFParallelLoopFusionPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createParallelLoopFusionPass();
});
}
inline void registerSCFParallelLoopSpecialization() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createParallelLoopSpecializationPass();
});
}
inline void registerSCFParallelLoopSpecializationPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createParallelLoopSpecializationPass();
});
}
inline void registerSCFParallelLoopTiling() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createParallelLoopTilingPass();
});
}
inline void registerSCFParallelLoopTilingPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createParallelLoopTilingPass();
});
}
inline void registerTestSCFParallelLoopCollapsing() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createTestSCFParallelLoopCollapsingPass();
});
}
inline void registerTestSCFParallelLoopCollapsingPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createTestSCFParallelLoopCollapsingPass();
});
}
inline void registerSCFPasses() {
registerSCFBufferize();
registerSCFForLoopCanonicalization();
registerSCFForLoopPeeling();
registerSCFForLoopRangeFolding();
registerSCFForLoopSpecialization();
registerSCFForToWhileLoop();
registerSCFForallToForLoop();
registerSCFForallToParallelLoop();
registerSCFParallelLoopFusion();
registerSCFParallelLoopSpecialization();
registerSCFParallelLoopTiling();
registerTestSCFParallelLoopCollapsing();
}
#undef GEN_PASS_REGISTRATION
#endif
#ifdef GEN_PASS_CLASSES
template <typename DerivedT>
class SCFBufferizeBase : public ::mlir::OperationPass<> {
public:
using Base = SCFBufferizeBase;
SCFBufferizeBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFBufferizeBase(const SCFBufferizeBase &other) : ::mlir::OperationPass<>(other) {}
SCFBufferizeBase& operator=(const SCFBufferizeBase &) = delete;
SCFBufferizeBase(SCFBufferizeBase &&) = delete;
SCFBufferizeBase& operator=(SCFBufferizeBase &&) = delete;
~SCFBufferizeBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-bufferize");
}
::llvm::StringRef getArgument() const override { return "scf-bufferize"; }
::llvm::StringRef getDescription() const override { return "Bufferize the scf dialect."; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFBufferize");
}
::llvm::StringRef getName() const override { return "SCFBufferize"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
registry.insert<bufferization::BufferizationDialect>();
registry.insert<memref::MemRefDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFBufferizeBase<DerivedT>)
protected:
};
template <typename DerivedT>
class SCFForLoopCanonicalizationBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForLoopCanonicalizationBase;
SCFForLoopCanonicalizationBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForLoopCanonicalizationBase(const SCFForLoopCanonicalizationBase &other) : ::mlir::OperationPass<>(other) {}
SCFForLoopCanonicalizationBase& operator=(const SCFForLoopCanonicalizationBase &) = delete;
SCFForLoopCanonicalizationBase(SCFForLoopCanonicalizationBase &&) = delete;
SCFForLoopCanonicalizationBase& operator=(SCFForLoopCanonicalizationBase &&) = delete;
~SCFForLoopCanonicalizationBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-for-loop-canonicalization");
}
::llvm::StringRef getArgument() const override { return "scf-for-loop-canonicalization"; }
::llvm::StringRef getDescription() const override { return "Canonicalize operations within scf.for loop bodies"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForLoopCanonicalization");
}
::llvm::StringRef getName() const override { return "SCFForLoopCanonicalization"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
registry.insert<affine::AffineDialect>();
registry.insert<tensor::TensorDialect>();
registry.insert<memref::MemRefDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForLoopCanonicalizationBase<DerivedT>)
protected:
};
template <typename DerivedT>
class SCFForLoopPeelingBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForLoopPeelingBase;
SCFForLoopPeelingBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForLoopPeelingBase(const SCFForLoopPeelingBase &other) : ::mlir::OperationPass<>(other) {}
SCFForLoopPeelingBase& operator=(const SCFForLoopPeelingBase &) = delete;
SCFForLoopPeelingBase(SCFForLoopPeelingBase &&) = delete;
SCFForLoopPeelingBase& operator=(SCFForLoopPeelingBase &&) = delete;
~SCFForLoopPeelingBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-for-loop-peeling");
}
::llvm::StringRef getArgument() const override { return "scf-for-loop-peeling"; }
::llvm::StringRef getDescription() const override { return "Peel `for` loops at their upper bounds."; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForLoopPeeling");
}
::llvm::StringRef getName() const override { return "SCFForLoopPeeling"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
registry.insert<affine::AffineDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForLoopPeelingBase<DerivedT>)
protected:
::mlir::Pass::Option<bool> peelFront{*this, "peel-front", ::llvm::cl::desc("Peel the first iteration out of the loop."), ::llvm::cl::init(false)};
::mlir::Pass::Option<bool> skipPartial{*this, "skip-partial", ::llvm::cl::desc("Do not peel loops inside of the last, partial iteration of another already peeled loop."), ::llvm::cl::init(true)};
};
template <typename DerivedT>
class SCFForLoopRangeFoldingBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForLoopRangeFoldingBase;
SCFForLoopRangeFoldingBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForLoopRangeFoldingBase(const SCFForLoopRangeFoldingBase &other) : ::mlir::OperationPass<>(other) {}
SCFForLoopRangeFoldingBase& operator=(const SCFForLoopRangeFoldingBase &) = delete;
SCFForLoopRangeFoldingBase(SCFForLoopRangeFoldingBase &&) = delete;
SCFForLoopRangeFoldingBase& operator=(SCFForLoopRangeFoldingBase &&) = delete;
~SCFForLoopRangeFoldingBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-for-loop-range-folding");
}
::llvm::StringRef getArgument() const override { return "scf-for-loop-range-folding"; }
::llvm::StringRef getDescription() const override { return "Fold add/mul ops into loop range"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForLoopRangeFolding");
}
::llvm::StringRef getName() const override { return "SCFForLoopRangeFolding"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForLoopRangeFoldingBase<DerivedT>)
protected:
};
template <typename DerivedT>
class SCFForLoopSpecializationBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForLoopSpecializationBase;
SCFForLoopSpecializationBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForLoopSpecializationBase(const SCFForLoopSpecializationBase &other) : ::mlir::OperationPass<>(other) {}
SCFForLoopSpecializationBase& operator=(const SCFForLoopSpecializationBase &) = delete;
SCFForLoopSpecializationBase(SCFForLoopSpecializationBase &&) = delete;
SCFForLoopSpecializationBase& operator=(SCFForLoopSpecializationBase &&) = delete;
~SCFForLoopSpecializationBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-for-loop-specialization");
}
::llvm::StringRef getArgument() const override { return "scf-for-loop-specialization"; }
::llvm::StringRef getDescription() const override { return "Specialize `for` loops for vectorization"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForLoopSpecialization");
}
::llvm::StringRef getName() const override { return "SCFForLoopSpecialization"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForLoopSpecializationBase<DerivedT>)
protected:
};
template <typename DerivedT>
class SCFForToWhileLoopBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForToWhileLoopBase;
SCFForToWhileLoopBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForToWhileLoopBase(const SCFForToWhileLoopBase &other) : ::mlir::OperationPass<>(other) {}
SCFForToWhileLoopBase& operator=(const SCFForToWhileLoopBase &) = delete;
SCFForToWhileLoopBase(SCFForToWhileLoopBase &&) = delete;
SCFForToWhileLoopBase& operator=(SCFForToWhileLoopBase &&) = delete;
~SCFForToWhileLoopBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-for-to-while");
}
::llvm::StringRef getArgument() const override { return "scf-for-to-while"; }
::llvm::StringRef getDescription() const override { return "Convert SCF for loops to SCF while loops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForToWhileLoop");
}
::llvm::StringRef getName() const override { return "SCFForToWhileLoop"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForToWhileLoopBase<DerivedT>)
protected:
};
template <typename DerivedT>
class SCFForallToForLoopBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForallToForLoopBase;
SCFForallToForLoopBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForallToForLoopBase(const SCFForallToForLoopBase &other) : ::mlir::OperationPass<>(other) {}
SCFForallToForLoopBase& operator=(const SCFForallToForLoopBase &) = delete;
SCFForallToForLoopBase(SCFForallToForLoopBase &&) = delete;
SCFForallToForLoopBase& operator=(SCFForallToForLoopBase &&) = delete;
~SCFForallToForLoopBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-forall-to-for");
}
::llvm::StringRef getArgument() const override { return "scf-forall-to-for"; }
::llvm::StringRef getDescription() const override { return "Convert SCF forall loops to SCF for loops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForallToForLoop");
}
::llvm::StringRef getName() const override { return "SCFForallToForLoop"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForallToForLoopBase<DerivedT>)
protected:
};
template <typename DerivedT>
class SCFForallToParallelLoopBase : public ::mlir::OperationPass<> {
public:
using Base = SCFForallToParallelLoopBase;
SCFForallToParallelLoopBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFForallToParallelLoopBase(const SCFForallToParallelLoopBase &other) : ::mlir::OperationPass<>(other) {}
SCFForallToParallelLoopBase& operator=(const SCFForallToParallelLoopBase &) = delete;
SCFForallToParallelLoopBase(SCFForallToParallelLoopBase &&) = delete;
SCFForallToParallelLoopBase& operator=(SCFForallToParallelLoopBase &&) = delete;
~SCFForallToParallelLoopBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-forall-to-parallel");
}
::llvm::StringRef getArgument() const override { return "scf-forall-to-parallel"; }
::llvm::StringRef getDescription() const override { return "Convert SCF forall loops to SCF parallel loops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFForallToParallelLoop");
}
::llvm::StringRef getName() const override { return "SCFForallToParallelLoop"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFForallToParallelLoopBase<DerivedT>)
protected:
};
template <typename DerivedT>
class SCFParallelLoopFusionBase : public ::mlir::OperationPass<> {
public:
using Base = SCFParallelLoopFusionBase;
SCFParallelLoopFusionBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFParallelLoopFusionBase(const SCFParallelLoopFusionBase &other) : ::mlir::OperationPass<>(other) {}
SCFParallelLoopFusionBase& operator=(const SCFParallelLoopFusionBase &) = delete;
SCFParallelLoopFusionBase(SCFParallelLoopFusionBase &&) = delete;
SCFParallelLoopFusionBase& operator=(SCFParallelLoopFusionBase &&) = delete;
~SCFParallelLoopFusionBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-parallel-loop-fusion");
}
::llvm::StringRef getArgument() const override { return "scf-parallel-loop-fusion"; }
::llvm::StringRef getDescription() const override { return "Fuse adjacent parallel loops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFParallelLoopFusion");
}
::llvm::StringRef getName() const override { return "SCFParallelLoopFusion"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFParallelLoopFusionBase<DerivedT>)
protected:
};
template <typename DerivedT>
class SCFParallelLoopSpecializationBase : public ::mlir::OperationPass<> {
public:
using Base = SCFParallelLoopSpecializationBase;
SCFParallelLoopSpecializationBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFParallelLoopSpecializationBase(const SCFParallelLoopSpecializationBase &other) : ::mlir::OperationPass<>(other) {}
SCFParallelLoopSpecializationBase& operator=(const SCFParallelLoopSpecializationBase &) = delete;
SCFParallelLoopSpecializationBase(SCFParallelLoopSpecializationBase &&) = delete;
SCFParallelLoopSpecializationBase& operator=(SCFParallelLoopSpecializationBase &&) = delete;
~SCFParallelLoopSpecializationBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-parallel-loop-specialization");
}
::llvm::StringRef getArgument() const override { return "scf-parallel-loop-specialization"; }
::llvm::StringRef getDescription() const override { return "Specialize parallel loops for vectorization"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFParallelLoopSpecialization");
}
::llvm::StringRef getName() const override { return "SCFParallelLoopSpecialization"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFParallelLoopSpecializationBase<DerivedT>)
protected:
};
template <typename DerivedT>
class SCFParallelLoopTilingBase : public ::mlir::OperationPass<> {
public:
using Base = SCFParallelLoopTilingBase;
SCFParallelLoopTilingBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
SCFParallelLoopTilingBase(const SCFParallelLoopTilingBase &other) : ::mlir::OperationPass<>(other) {}
SCFParallelLoopTilingBase& operator=(const SCFParallelLoopTilingBase &) = delete;
SCFParallelLoopTilingBase(SCFParallelLoopTilingBase &&) = delete;
SCFParallelLoopTilingBase& operator=(SCFParallelLoopTilingBase &&) = delete;
~SCFParallelLoopTilingBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("scf-parallel-loop-tiling");
}
::llvm::StringRef getArgument() const override { return "scf-parallel-loop-tiling"; }
::llvm::StringRef getDescription() const override { return "Tile parallel loops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("SCFParallelLoopTiling");
}
::llvm::StringRef getName() const override { return "SCFParallelLoopTiling"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
registry.insert<affine::AffineDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SCFParallelLoopTilingBase<DerivedT>)
protected:
::mlir::Pass::ListOption<int64_t> tileSizes{*this, "parallel-loop-tile-sizes", ::llvm::cl::desc("Factors to tile parallel loops by")};
::mlir::Pass::Option<bool> noMinMaxBounds{*this, "no-min-max-bounds", ::llvm::cl::desc("Perform tiling with fixed upper bound with inbound check inside the internal loops"), ::llvm::cl::init(false)};
};
template <typename DerivedT>
class TestSCFParallelLoopCollapsingBase : public ::mlir::OperationPass<> {
public:
using Base = TestSCFParallelLoopCollapsingBase;
TestSCFParallelLoopCollapsingBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
TestSCFParallelLoopCollapsingBase(const TestSCFParallelLoopCollapsingBase &other) : ::mlir::OperationPass<>(other) {}
TestSCFParallelLoopCollapsingBase& operator=(const TestSCFParallelLoopCollapsingBase &) = delete;
TestSCFParallelLoopCollapsingBase(TestSCFParallelLoopCollapsingBase &&) = delete;
TestSCFParallelLoopCollapsingBase& operator=(TestSCFParallelLoopCollapsingBase &&) = delete;
~TestSCFParallelLoopCollapsingBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("test-scf-parallel-loop-collapsing");
}
::llvm::StringRef getArgument() const override { return "test-scf-parallel-loop-collapsing"; }
::llvm::StringRef getDescription() const override { return "Test parallel loops collapsing transformation"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("TestSCFParallelLoopCollapsing");
}
::llvm::StringRef getName() const override { return "TestSCFParallelLoopCollapsing"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
registry.insert<affine::AffineDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestSCFParallelLoopCollapsingBase<DerivedT>)
protected:
::mlir::Pass::ListOption<unsigned> clCollapsedIndices0{*this, "collapsed-indices-0", ::llvm::cl::desc("Which loop indices to combine 0th loop index")};
::mlir::Pass::ListOption<unsigned> clCollapsedIndices1{*this, "collapsed-indices-1", ::llvm::cl::desc("Which loop indices to combine into the position 1 loop index")};
::mlir::Pass::ListOption<unsigned> clCollapsedIndices2{*this, "collapsed-indices-2", ::llvm::cl::desc("Which loop indices to combine into the position 2 loop index")};
};
#undef GEN_PASS_CLASSES
#endif