Skip to content

Commit 743ab25

Browse files
authored
Move CSE out of MIGraphXToTosaPass (#2012)
* Move CSE pass invocation out of MIGraphXToTosaPass * Update LIT tests
1 parent ec067ce commit 743ab25

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

mlir/lib/Conversion/MIGraphXToTosa/MIGraphXToTosaPass.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,6 @@ void MIGraphXToTosa::runOnOperation() {
114114
if (failed(applyPartialConversion(func, boundaryConversionTarget,
115115
std::move(boundaryPatterns))))
116116
return signalPassFailure();
117-
118-
OpPassManager cleanPM("func.func");
119-
cleanPM.addPass(createCSEPass());
120-
(void)runPipeline(cleanPM, func);
121117
}
122118

123119
void mlir::migraphx::addMIGraphXToTosaPasses(OpPassManager &pm) {

mlir/lib/Dialect/MIGraphX/Pipeline/Pipeline.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ void migraphx::addHighLevelPipeline(PassManager &pm) {
4646
funcPm.addPass(migraphx::createMIGraphXTransformPass());
4747
funcPm.addPass(createCanonicalizerPass());
4848
funcPm.addPass(createMIGraphXToTosaPass());
49+
funcPm.addPass(createCSEPass());
4950
funcPm.addPass(migraphx::createMIGraphXTosaSimplifyPass());
5051
}

mlir/test/Conversion/MIGraphXToTosa/mixr-to-tosa-ops.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: rocmlir-opt -split-input-file --migraphx-transform --canonicalize --migraphx-to-tosa %s -verify-diagnostics -o -| FileCheck %s
1+
// RUN: rocmlir-opt -split-input-file --migraphx-transform --canonicalize --migraphx-to-tosa --cse %s -verify-diagnostics -o -| FileCheck %s
22

33
module {
44
// CHECK-LABEL: func @literal_zero

mlir/test/rocmlir-driver/pipelines.mlir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// MIGRAPHX-NEXT:migraphx-transform,
1313
// MIGRAPHX-NEXT:canonicalize{ max-iterations=10 max-num-rewrites=-1 region-simplify=normal test-convergence=false top-down=true},
1414
// MIGRAPHX-NEXT:migraphx-to-tosa,
15+
// MIGRAPHX-NEXT:cse,
1516
// MIGRAPHX-NEXT:migraphx-tosa-simplify))
1617

1718
// GPU:Kernel pipeline:

0 commit comments

Comments
 (0)