Skip to content

Commit a87e193

Browse files
committed
make ip a property
1 parent 68264af commit a87e193

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mlir/lib/Bindings/Python/Rewrite.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ class PyFrozenRewritePatternSet {
170170

171171
/// Create the `mlir.rewrite` here.
172172
void mlir::python::populateRewriteSubmodule(nb::module_ &m) {
173-
nb::class_<PyPatternRewriter>(m, "PyPatternRewriter")
174-
.def("ip", &PyPatternRewriter::getInsertionPoint);
173+
nb::class_<PyPatternRewriter>(m, "PatternRewriter")
174+
.def_prop_ro("ip", &PyPatternRewriter::getInsertionPoint,
175+
"The current insertion point of the PatternRewriter.");
175176
//----------------------------------------------------------------------------
176177
// Mapping of the PDLResultList and PDLModule
177178
//----------------------------------------------------------------------------

mlir/test/python/integration/dialects/pdl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def expand(rewriter, results, values):
274274
cst = values[0].value
275275
c1 = cst // 2
276276
c2 = cst - c1
277-
with rewriter.ip():
277+
with rewriter.ip:
278278
op1 = Operation.create(
279279
"myint.constant",
280280
results=[i32],

0 commit comments

Comments
 (0)