Commit b581c8b1 authored by jungpark-mlir's avatar jungpark-mlir
Browse files

Update mlir.cpp

parent 75bfeada
...@@ -541,12 +541,16 @@ struct mlir_program ...@@ -541,12 +541,16 @@ struct mlir_program
code_object_op compile() MIGRAPHX_TIDY_CONST code_object_op compile() MIGRAPHX_TIDY_CONST
{ {
mlir_pass_manager pm{mlirPassManagerCreate(ctx.get())}; mlir_pass_manager pm_front{mlirPassManagerCreate(ctx.get())};
mlir_pass_manager pm_back{mlirPassManagerCreate(ctx.get())};
// 1st pipeline to call // 1st pipeline to call
mlirMIGraphXAddHighLevelPipeline(pm.get()); mlirMIGraphXAddHighLevelPipeline(pm_front.get());
mlirPassManagerRun(pm_front.get(), mmodule.get());
// 2nd pipeline to call // 2nd pipeline to call
mlirMIGraphXAddBackendPipeline(pm.get(), target_arch.c_str()); get_module_tuned();
mlirPassManagerRun(pm.get(), mmodule.get()); mlirMIGraphXAddBackendPipeline(pm_back.get(), target_arch.c_str());
mlirPassManagerRun(pm_back.get(), mmodule.get());
code_object_op op{}; code_object_op op{};
op.symbol_name = "mlir_main"; op.symbol_name = "mlir_main";
...@@ -599,7 +603,7 @@ struct mlir_program ...@@ -599,7 +603,7 @@ struct mlir_program
{ {
if(!mlirRockTuningSetFromTable(tuning_table, mmodule.get())) if(!mlirRockTuningSetFromTable(tuning_table, mmodule.get()))
{ {
printf("fails to set param on %s\n", mlirRockTuningGetKey(tuning_table, module)); printf("fails to set param on <%s>\n", mlirRockTuningGetKey(tuning_table, mmodule.get()));
return false; return false;
} }
return true; return true;
...@@ -681,7 +685,6 @@ code_object_op compile_mlir(const context&, module m, const std::vector<instruct ...@@ -681,7 +685,6 @@ code_object_op compile_mlir(const context&, module m, const std::vector<instruct
mp.find_target(); mp.find_target();
mp.parse(m); mp.parse(m);
mp.tuning_table_create(); mp.tuning_table_create();
mp.get_module_tuned();
auto mod_op = mlirModuleGetOperation(mp.mmodule.get()); auto mod_op = mlirModuleGetOperation(mp.mmodule.get());
if(trace) if(trace)
std::cout << mlir_print(&mlirOperationPrint, mod_op) << std::endl; std::cout << mlir_print(&mlirOperationPrint, mod_op) << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment