[Mlir-commits] [mlir] [mlir-c] Add mlirDialectMaterializeConstant (PR #206553)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Sep 25 00:14:05 PDT 2026
================
@@ -304,6 +304,18 @@ void mlirIRRewriterDestroy(MlirRewriterBase rewriter) {
delete static_cast<IRRewriter *>(unwrap(rewriter));
}
+//===----------------------------------------------------------------------===//
+/// Dialect constant materialization API
+//===----------------------------------------------------------------------===//
+
+MlirOperation mlirDialectMaterializeConstant(MlirDialect dialect,
+ MlirRewriterBase rewriter,
+ MlirAttribute value, MlirType type,
+ MlirLocation loc) {
+ return wrap(unwrap(dialect)->materializeConstant(
+ *unwrap(rewriter), unwrap(value), unwrap(type), unwrap(loc)));
+}
----------------
PragmaTwice wrote:
In the Python side maybe we want a `InsertionPoint` version? like `with ip, loc: dialect.materialize_constant(attr, ty)`. Though the current one is fine to me.
https://github.com/llvm/llvm-project/pull/206553
More information about the Mlir-commits
mailing list