Skip to content

Commit

Permalink
rename pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxlonelyeagle committed Feb 6, 2024
1 parent fdc919a commit d1b68d7
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion stablehlo/tests/chlo/legalize_chlo_decomposition.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: stablehlo-opt --pass-pipeline="builtin.module(func.func(stablehlo-legalize-chlo))" \
// RUN: stablehlo-opt --pass-pipeline="builtin.module(func.func(chlo-legalize-to-stablehlo))" \
// RUN: --split-input-file --verify-diagnostics %s | FileCheck %s

// CHECK-LABEL: func.func @asin_bf16(
Expand Down
2 changes: 1 addition & 1 deletion stablehlo/tests/chlo/legalize_chlo_no_broadcast.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: stablehlo-opt --pass-pipeline="builtin.module(func.func(stablehlo-legalize-chlo),cse)" \
// RUN: stablehlo-opt --pass-pipeline="builtin.module(func.func(chlo-legalize-to-stablehlo),cse)" \
// RUN: --split-input-file --verify-diagnostics %s | FileCheck %s

// Check the non-broadcast case for each registered op, then just check a
Expand Down
2 changes: 1 addition & 1 deletion stablehlo/tests/chlo/legalize_chlo_with_broadcast.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: stablehlo-opt --pass-pipeline="builtin.module(func.func(stablehlo-legalize-chlo),cse)" \
// RUN: stablehlo-opt --pass-pipeline="builtin.module(func.func(chlo-legalize-to-stablehlo),cse)" \
// RUN: --split-input-file --verify-diagnostics %s | FileCheck %s

// Check the non-broadcast case for each registered op, then just check a
Expand Down
4 changes: 2 additions & 2 deletions stablehlo/transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ add_mlir_dialect_library(StablehloPasses
VhloLegalizeToStablehlo.cpp
VhloToVersion.cpp
ChloLegalizeToStablehlo.cpp
StablehloCanonicalize.cpp

StablehloAggressiveSimplification.cpp
DEPENDS
PassesIncGen
ChloDecompositionPatterns
Expand Down
5 changes: 3 additions & 2 deletions stablehlo/transforms/ChloLegalizeToStablehlo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace mlir {
namespace stablehlo {

#define GEN_PASS_DEF_LEGALIZECHLO
#define GEN_PASS_DEF_CHLOLEGALIZETOSTABLEHLOPASS
#include "stablehlo/transforms/Passes.h.inc"

namespace {
Expand Down Expand Up @@ -2161,7 +2161,8 @@ struct ConvertZetaOp final : OpConversionPattern<mlir::chlo::ZetaOp> {
// Pass Definition.
//===----------------------------------------------------------------------===//

struct LegalizeChlo final : impl::LegalizeChloBase<LegalizeChlo> {
struct ChloLegalizeToStablehloPass final
: impl::ChloLegalizeToStablehloPassBase<ChloLegalizeToStablehloPass> {
void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<mlir::scf::SCFDialect, mlir::shape::ShapeDialect,
mlir::stablehlo::StablehloDialect,
Expand Down
8 changes: 4 additions & 4 deletions stablehlo/transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ def VhloToVersionPass : Pass<"vhlo-to-version"> {
];
}

def LegalizeChlo :
InterfacePass<"stablehlo-legalize-chlo", "mlir::FunctionOpInterface"> {
def ChloLegalizeToStablehloPass :
InterfacePass<"chlo-legalize-to-stablehlo", "mlir::FunctionOpInterface"> {
let summary = "Legalizes from CHLO ops flow to StableHLO and Shape ops";
}

def StableHLOCanonicalize :
InterfacePass<"stablehlo-canonicalize", "mlir::FunctionOpInterface"> {
def StablehloAggressiveSimplificationPass :
InterfacePass<"stablehlo-aggressive-simplification", "mlir::FunctionOpInterface"> {
let summary = "Canonicalizes StableHLO operations";
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
namespace mlir {
namespace stablehlo {

#define GEN_PASS_DEF_STABLEHLOCANONICALIZE
#define GEN_PASS_DEF_STABLEHLOAGGRESSIVESIMPLIFICATIONPASS
#include "stablehlo/transforms/Passes.h.inc"

namespace {
Expand Down Expand Up @@ -1129,8 +1129,9 @@ struct ReorderElementwiseAndShapeOp final
}
};

struct StableHLOCanonicalize final
: impl::StableHLOCanonicalizeBase<StableHLOCanonicalize> {
struct StablehloAggressiveSimplificationPass final
: impl::StablehloAggressiveSimplificationPassBase<
StablehloAggressiveSimplificationPass> {
void runOnOperation() override {
MLIRContext *ctx = &getContext();
RewritePatternSet patterns(ctx);
Expand Down

0 comments on commit d1b68d7

Please sign in to comment.