Skip to content

Commit a51c1f8

Browse files
authored
[mlir] Remove deprecated GEN_PASS_CLASSES (#167496)
Update CIR & flang in preparation for removing in #166904 (split out from there, sufficient approvals there but wanted to enable more time to removing feature).
1 parent b4c4013 commit a51c1f8

File tree

8 files changed

+40
-8
lines changed

8 files changed

+40
-8
lines changed

clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
using namespace mlir;
2727
using namespace cir;
2828

29+
namespace mlir {
30+
#define GEN_PASS_DEF_CIRCANONICALIZE
31+
#include "clang/CIR/Dialect/Passes.h.inc"
32+
} // namespace mlir
33+
2934
namespace {
3035

3136
/// Removes branches between two blocks if it is the only branch.
@@ -101,7 +106,8 @@ struct RemoveEmptySwitch : public OpRewritePattern<SwitchOp> {
101106
// CIRCanonicalizePass
102107
//===----------------------------------------------------------------------===//
103108

104-
struct CIRCanonicalizePass : public CIRCanonicalizeBase<CIRCanonicalizePass> {
109+
struct CIRCanonicalizePass
110+
: public impl::CIRCanonicalizeBase<CIRCanonicalizePass> {
105111
using CIRCanonicalizeBase::CIRCanonicalizeBase;
106112

107113
// The same operation rewriting done here could have been performed

clang/lib/CIR/Dialect/Transforms/CIRSimplify.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
using namespace mlir;
2222
using namespace cir;
2323

24+
namespace mlir {
25+
#define GEN_PASS_DEF_CIRSIMPLIFY
26+
#include "clang/CIR/Dialect/Passes.h.inc"
27+
} // namespace mlir
28+
2429
//===----------------------------------------------------------------------===//
2530
// Rewrite patterns
2631
//===----------------------------------------------------------------------===//
@@ -283,7 +288,7 @@ struct SimplifyVecSplat : public OpRewritePattern<VecSplatOp> {
283288
// CIRSimplifyPass
284289
//===----------------------------------------------------------------------===//
285290

286-
struct CIRSimplifyPass : public CIRSimplifyBase<CIRSimplifyPass> {
291+
struct CIRSimplifyPass : public impl::CIRSimplifyBase<CIRSimplifyPass> {
287292
using CIRSimplifyBase::CIRSimplifyBase;
288293

289294
void runOnOperation() override;

clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
using namespace mlir;
2727
using namespace cir;
2828

29+
namespace mlir {
30+
#define GEN_PASS_DEF_CIRFLATTENCFG
31+
#include "clang/CIR/Dialect/Passes.h.inc"
32+
} // namespace mlir
33+
2934
namespace {
3035

3136
/// Lowers operations with the terminator trait that have a single successor.
@@ -50,7 +55,7 @@ void walkRegionSkipping(
5055
});
5156
}
5257

53-
struct CIRFlattenCFGPass : public CIRFlattenCFGBase<CIRFlattenCFGPass> {
58+
struct CIRFlattenCFGPass : public impl::CIRFlattenCFGBase<CIRFlattenCFGPass> {
5459

5560
CIRFlattenCFGPass() = default;
5661
void runOnOperation() override;

clang/lib/CIR/Dialect/Transforms/GotoSolver.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@
1414
using namespace mlir;
1515
using namespace cir;
1616

17+
namespace mlir {
18+
#define GEN_PASS_DEF_GOTOSOLVER
19+
#include "clang/CIR/Dialect/Passes.h.inc"
20+
} // namespace mlir
21+
1722
namespace {
1823

19-
struct GotoSolverPass : public GotoSolverBase<GotoSolverPass> {
24+
struct GotoSolverPass : public impl::GotoSolverBase<GotoSolverPass> {
2025
GotoSolverPass() = default;
2126
void runOnOperation() override;
2227
};

clang/lib/CIR/Dialect/Transforms/HoistAllocas.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@
2020
using namespace mlir;
2121
using namespace cir;
2222

23+
namespace mlir {
24+
#define GEN_PASS_DEF_HOISTALLOCAS
25+
#include "clang/CIR/Dialect/Passes.h.inc"
26+
} // namespace mlir
27+
2328
namespace {
2429

25-
struct HoistAllocasPass : public HoistAllocasBase<HoistAllocasPass> {
30+
struct HoistAllocasPass : public impl::HoistAllocasBase<HoistAllocasPass> {
2631

2732
HoistAllocasPass() = default;
2833
void runOnOperation() override;

clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
using namespace mlir;
2424
using namespace cir;
2525

26+
namespace mlir {
27+
#define GEN_PASS_DEF_LOWERINGPREPARE
28+
#include "clang/CIR/Dialect/Passes.h.inc"
29+
} // namespace mlir
30+
2631
static SmallString<128> getTransformedFileName(mlir::ModuleOp mlirModule) {
2732
SmallString<128> fileName;
2833

@@ -53,7 +58,8 @@ static cir::FuncOp getCalledFunction(cir::CallOp callOp) {
5358
}
5459

5560
namespace {
56-
struct LoweringPreparePass : public LoweringPrepareBase<LoweringPreparePass> {
61+
struct LoweringPreparePass
62+
: public impl::LoweringPrepareBase<LoweringPreparePass> {
5763
LoweringPreparePass() = default;
5864
void runOnOperation() override;
5965

clang/lib/CIR/Dialect/Transforms/PassDetail.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace mlir {
2121
template <typename ConcreteDialect>
2222
void registerDialect(DialectRegistry &registry);
2323

24-
#define GEN_PASS_CLASSES
24+
#define GEN_PASS_DECL
2525
#include "clang/CIR/Dialect/Passes.h.inc"
2626

2727
} // namespace mlir

flang/lib/Optimizer/CodeGen/PassDetail.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace fir {
2020

21-
#define GEN_PASS_CLASSES
21+
#define GEN_PASS_DECL
2222
#include "flang/Optimizer/CodeGen/CGPasses.h.inc"
2323

2424
} // namespace fir

0 commit comments

Comments
 (0)