Skip to content

Commit

Permalink
[xla-next][mlir][sparse] add mhlo sparsity rewriting to pipeline
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 511567163
  • Loading branch information
aartbik authored and copybara-github committed Feb 22, 2023
1 parent 0ae88ee commit b4d47d3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xla/service/cpu/hlo_xla_runtime_pipeline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ static Status CreateHloXlaPipeline(
pm.addPass(mlir::createCSEPass());
pm.addPass(mlir::createCanonicalizerPass());

// Some early sparse rewriting rules.
if (options.sparse_bufferization) {
pm.addNestedPass<mlir::func::FuncOp>(
mlir::mhlo::createSparseRewritingPass());
}

// Transform HLO operations to Linalg.
pm.addNestedPass<mlir::func::FuncOp>(mlir::mhlo::createLegalizeSortPass());
pm.addNestedPass<mlir::func::FuncOp>(
Expand Down

0 comments on commit b4d47d3

Please sign in to comment.