[Mlir-commits] [mlir] [mlir][tensor] move tensor insert canonicalization to pattern (PR #142671)

Mehdi Amini llvmlistbot at llvm.org
Tue Jun 3 15:05:23 PDT 2025


================
@@ -176,6 +176,9 @@ void populateFoldConstantExtractSlicePatterns(
           return false;
         });
 
+/// Patterns to fold inserts into a constant into a new constant.
+void populateFoldInsertAfterConstant(RewritePatternSet &patterns);
----------------
joker-eph wrote:

I'm not comfortable with dedicated API exposing single patterns, that does not seem super principled to me in general unfortunately. We should group things in optimization passes that are coherent and consistent.

Otherwise this leads to a zoo of APIs that are just completely ad-hoc and not really usable IMO.

https://github.com/llvm/llvm-project/pull/142671


More information about the Mlir-commits mailing list