From 98f42955828ba4028035dd30e2b57400a393bf55 Mon Sep 17 00:00:00 2001 From: Shenghang Tsai Date: Wed, 27 Nov 2024 20:04:46 +0800 Subject: [PATCH] Upgrade MLIR with new IR print option (#372) --- dev-requirements.txt | 4 ++-- lib/beaver/mlir/pass_manager.ex | 4 +++- test/memref_test.exs | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 6fb89660..eaae332d 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,3 +1,3 @@ -mlir==20.0.0.2024102001+2deb3a26; sys_platform != "linux" -mlir==20.0.0.2024102001+cuda.2deb3a26; sys_platform == "linux" +mlir==20.0.0.2024112701+fad5ed6e; sys_platform != "linux" +mlir==20.0.0.2024112701+cuda.fad5ed6e; sys_platform == "linux" --find-links https://github.com/makslevental/mlir-wheels/releases/expanded_assets/latest diff --git a/lib/beaver/mlir/pass_manager.ex b/lib/beaver/mlir/pass_manager.ex index 13b0223f..ffdf078d 100644 --- a/lib/beaver/mlir/pass_manager.ex +++ b/lib/beaver/mlir/pass_manager.ex @@ -12,6 +12,7 @@ defmodule Beaver.MLIR.PassManager do | {:module_scope, boolean()} | {:after_only_on_change, boolean()} | {:after_only_on_failure, boolean()} + | {:tree_printing_path, String.t()} @type print_opts :: [print_opt()] @spec enable_ir_printing(MLIR.PassManager.t(), print_opts()) :: :ok def enable_ir_printing(%MLIR.PassManager{} = pm, opts \\ []) do @@ -21,7 +22,8 @@ defmodule Beaver.MLIR.PassManager do !!Keyword.get(opts, :after_all, true), !!Keyword.get(opts, :module_scope, false), !!Keyword.get(opts, :after_only_on_change, false), - !!Keyword.get(opts, :after_only_on_failure, false) + !!Keyword.get(opts, :after_only_on_failure, false), + MLIR.StringRef.create(Keyword.get(opts, :tree_printing_path, "")) ) end end diff --git a/test/memref_test.exs b/test/memref_test.exs index ba40fe0e..9142f50f 100644 --- a/test/memref_test.exs +++ b/test/memref_test.exs @@ -39,7 +39,7 @@ defmodule MemRefTest do |> Beaver.Composer.append("one-shot-bufferize") |> Beaver.Composer.nested( "func.func", - ~w{finalizing-bufferize buffer-deallocation convert-linalg-to-loops} + ~w{buffer-deallocation convert-linalg-to-loops} ) |> convert_scf_to_cf |> Beaver.Composer.append("finalize-memref-to-llvm")