diff --git a/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CommonExtensions.cpp b/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CommonExtensions.cpp index 7b904e40a231..86c0a107d847 100644 --- a/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CommonExtensions.cpp +++ b/compiler/src/iree/compiler/Codegen/Common/TransformExtensions/CommonExtensions.cpp @@ -964,14 +964,6 @@ DiagnosedSilenceableFailure transform_dialect::IREEBufferizeOp::apply( return listener.checkAndResetError(); } - // 3. Post-bufferization passes are fine. - PassManager pm(getContext()); - addIREEPostBufferizationPasses(pm); - if (failed(pm.run(target))) { - return mlir::emitDefiniteFailure(target) - << "post-bufferization passes failed"; - } - results.set(getOperation()->getOpResult(0), {target}); return listener.checkAndResetError(); } diff --git a/compiler/src/iree/compiler/Codegen/LLVMCPU/test/transform_dialect_bufferize.mlir b/compiler/src/iree/compiler/Codegen/LLVMCPU/test/transform_dialect_bufferize.mlir index a2944d9d125c..866f43956822 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMCPU/test/transform_dialect_bufferize.mlir +++ b/compiler/src/iree/compiler/Codegen/LLVMCPU/test/transform_dialect_bufferize.mlir @@ -35,7 +35,10 @@ module attributes {transform.with_named_sequence} { transform.print %8 : !transform.any_op transform.iree.eliminate_empty_tensors %8 : (!transform.any_op) -> () %9 = transform.iree.bufferize %8 : (!transform.any_op) -> !transform.any_op - // %9 = transform.structured.match ops{["func.func"]} in %8 : (!transform.any_op) -> !transform.any_op + %10 = transform.structured.match ops{["func.func"]} in %9 : (!transform.any_op) -> !transform.op<"func.func"> + transform.apply_patterns to %10 { + transform.apply_patterns.canonicalization + } : !transform.op<"func.func"> transform.yield } } diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/test/transform_dialect_codegen_bufferize_spec.mlir b/compiler/src/iree/compiler/Codegen/LLVMGPU/test/transform_dialect_codegen_bufferize_spec.mlir index 89853b6352a4..24da7997aa53 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/test/transform_dialect_codegen_bufferize_spec.mlir +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/test/transform_dialect_codegen_bufferize_spec.mlir @@ -4,10 +4,14 @@ module attributes { transform.with_named_sequence } { %tensor_func = transform.structured.match ops{["func.func"]} in %variant_op : (!transform.any_op) -> !transform.any_op transform.iree.eliminate_empty_tensors %tensor_func : (!transform.any_op) -> () %memref_func = transform.iree.bufferize %tensor_func : (!transform.any_op) -> !transform.any_op + %func_op_bufferized = transform.structured.match ops{["func.func"]} in %memref_func : (!transform.any_op) -> !transform.op<"func.func"> + transform.apply_patterns to %func_op_bufferized { + transform.apply_patterns.canonicalization + } : !transform.op<"func.func"> // Annotate the exported function as already translated. %none = transform.param.constant #iree_codegen.translation_info -> !transform.any_param - transform.annotate %memref_func "translation_info" = %none : !transform.any_op, !transform.any_param + transform.annotate %func_op_bufferized "translation_info" = %none : !transform.op<"func.func">, !transform.any_param transform.yield } } // module diff --git a/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableBenchmarks.cpp b/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableBenchmarks.cpp index 9d7cc63165b9..83064ccdd96e 100644 --- a/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableBenchmarks.cpp +++ b/compiler/src/iree/compiler/Dialect/HAL/Transforms/DumpExecutableBenchmarks.cpp @@ -18,9 +18,11 @@ #include "llvm/Support/Path.h" #include "llvm/Support/ToolOutputFile.h" #include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/IR/Dominance.h" #include "mlir/Pass/Pass.h" #include "mlir/Pass/PassManager.h" #include "mlir/Support/FileUtilities.h" +#include "mlir/Transforms/CSE.h" #include "mlir/Transforms/Passes.h" // NOTE: redundant bindings will result in unique buffer locations during the @@ -447,14 +449,9 @@ buildBenchmarkModule(IREE::HAL::ExecutableOp sourceExecutableOp, if (!hasAnyBenchmarks) return {}; - // Run CSE and the canonicalizer to pretty up the output. - PassManager passManager(moduleOp->getContext()); - passManager.addPass(mlir::createCanonicalizerPass()); - passManager.addPass(mlir::createCSEPass()); - if (failed(passManager.run(*moduleOp))) { - moduleOp->emitError("failed to run canonicalizer; malformed output"); - return {}; - } + IRRewriter rewriter(moduleOp->getContext()); + DominanceInfo domInfo; + mlir::eliminateCommonSubExpressions(rewriter, domInfo, moduleOp.get()); return moduleOp; } diff --git a/third_party/llvm-project b/third_party/llvm-project index 8cb4b3e21e03..1cd4725bb8e4 160000 --- a/third_party/llvm-project +++ b/third_party/llvm-project @@ -1 +1 @@ -Subproject commit 8cb4b3e21e03d3e029ade27139eab1a25720c773 +Subproject commit 1cd4725bb8e41ef48c7898da895daeb5275d8a92 diff --git a/third_party/torch-mlir b/third_party/torch-mlir index eefc553ffca4..36c47e652b58 160000 --- a/third_party/torch-mlir +++ b/third_party/torch-mlir @@ -1 +1 @@ -Subproject commit eefc553ffca45fd2432641918a73b810f64bba39 +Subproject commit 36c47e652b58db24b3c6bafc56e103d39a9befe1