<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/CAPI/IR/Pass.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[MLIR][Python] Expose `PassManager::enableStatistics` to CAPI and Python (#162591)</title>
<updated>2025-10-09T12:11:19+00:00</updated>
<author>
<name>Twice</name>
<email>twice@apache.org</email>
</author>
<published>2025-10-09T12:11:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d12b0e25392e2cc91cc7a8218989cba0cb952719'/>
<id>d12b0e25392e2cc91cc7a8218989cba0cb952719</id>
<content type='text'>
`PassManager::enableStatistics` seems currently missing in both C API
and Python bindings. So here we added them in this PR, which includes
the `PassDisplayMode` enum type and the `EnableStatistics` method.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`PassManager::enableStatistics` seems currently missing in both C API
and Python bindings. So here we added them in this PR, which includes
the `PassDisplayMode` enum type and the `EnableStatistics` method.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Python] Support Python-defined passes in MLIR (#156000)</title>
<updated>2025-09-09T01:01:23+00:00</updated>
<author>
<name>Twice</name>
<email>twice@apache.org</email>
</author>
<published>2025-09-09T01:01:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7d04e3790483f8e2f168ec538682bc31d3011a0b'/>
<id>7d04e3790483f8e2f168ec538682bc31d3011a0b</id>
<content type='text'>
It closes #155996.

This PR added a method `add(callable, ..)` to
`mlir.passmanager.PassManager` to accept a callable object for defining
passes in the Python side.

This is a simple example of a Python-defined pass.
```python
from mlir.passmanager import PassManager

def demo_pass_1(op):
    # do something with op
    pass

class DemoPass:
    def __init__(self, ...):
        pass
    def __call__(op):
        # do something
        pass

demo_pass_2 = DemoPass(..)

pm = PassManager('any', ctx)
pm.add(demo_pass_1)
pm.add(demo_pass_2)
pm.add("registered-passes")
pm.run(..)
```

---------

Co-authored-by: cnb.bsD2OPwAgEA &lt;QejD2DJ2eEahUVy6Zg0aZI+cnb.bsD2OPwAgEA@noreply.cnb.cool&gt;
Co-authored-by: Maksim Levental &lt;maksim.levental@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It closes #155996.

This PR added a method `add(callable, ..)` to
`mlir.passmanager.PassManager` to accept a callable object for defining
passes in the Python side.

This is a simple example of a Python-defined pass.
```python
from mlir.passmanager import PassManager

def demo_pass_1(op):
    # do something with op
    pass

class DemoPass:
    def __init__(self, ...):
        pass
    def __call__(op):
        # do something
        pass

demo_pass_2 = DemoPass(..)

pm = PassManager('any', ctx)
pm.add(demo_pass_1)
pm.add(demo_pass_2)
pm.add("registered-passes")
pm.run(..)
```

---------

Co-authored-by: cnb.bsD2OPwAgEA &lt;QejD2DJ2eEahUVy6Zg0aZI+cnb.bsD2OPwAgEA@noreply.cnb.cool&gt;
Co-authored-by: Maksim Levental &lt;maksim.levental@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Add Python bindings to enable default passmanager timing (#149087)</title>
<updated>2025-07-16T14:45:15+00:00</updated>
<author>
<name>Martin Erhart</name>
<email>martin.erhart@sifive.com</email>
</author>
<published>2025-07-16T14:45:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=616e4c43dd196450b11376971966d71e501c26b8'/>
<id>616e4c43dd196450b11376971966d71e501c26b8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Python] enhance python ir printing with pringing flags (#117836)</title>
<updated>2024-12-05T09:31:04+00:00</updated>
<author>
<name>Yuanqiang Liu</name>
<email>liuyuanqiang.yqliu@bytedance.com</email>
</author>
<published>2024-12-05T09:31:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2e51e150e161bd5fb5b8adb8655744a672ced002'/>
<id>2e51e150e161bd5fb5b8adb8655744a672ced002</id>
<content type='text'>
Close https://github.com/llvm/llvm-project/pull/65854</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Close https://github.com/llvm/llvm-project/pull/65854</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Python] Add the `--mlir-print-ir-tree-dir` to the C and Python API (#117339)</title>
<updated>2024-11-23T19:17:25+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2024-11-23T19:17:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c8b837ad8ce4f36a3b2e47f1f1367dc0b41fca7b'/>
<id>c8b837ad8ce4f36a3b2e47f1f1367dc0b41fca7b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR] [Python] align python ir printing with mlir-print-ir-after-all (#107522)</title>
<updated>2024-09-18T03:54:16+00:00</updated>
<author>
<name>Bimo</name>
<email>rui.xu@intel.com</email>
</author>
<published>2024-09-18T03:54:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f8eceb45d0bbca092164efffc92f2e9d66b304a5'/>
<id>f8eceb45d0bbca092164efffc92f2e9d66b304a5</id>
<content type='text'>
When using the `enable_ir_printing` API from Python, it invokes IR
printing with default args, printing the IR before each pass and
printing IR after pass only if there have been changes. This PR attempts
to align the `enable_ir_printing` API with the documentation</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When using the `enable_ir_printing` API from Python, it invokes IR
printing with default args, printing the IR before each pass and
printing IR after pass only if there have been changes. This PR attempts
to align the `enable_ir_printing` API with the documentation</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][CAPI] Allow running pass manager on any operation</title>
<updated>2023-03-01T23:17:13+00:00</updated>
<author>
<name>rkayaith</name>
<email>rkayaith@gmail.com</email>
</author>
<published>2022-11-09T03:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6f5590ca347a5a2467b8aaea4b24bc9b70ef138f'/>
<id>6f5590ca347a5a2467b8aaea4b24bc9b70ef138f</id>
<content type='text'>
`mlirPassManagerRun` is currently restricted to running on
`builtin.module` ops, but this restriction doesn't exist on the C++
side. This renames it to `mlirPassManagerRunOnOp` and updates it to take
`MlirOperation` instead of `MlirModule`.

Depends on D143352

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D143354
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`mlirPassManagerRun` is currently restricted to running on
`builtin.module` ops, but this restriction doesn't exist on the C++
side. This renames it to `mlirPassManagerRunOnOp` and updates it to take
`MlirOperation` instead of `MlirModule`.

Depends on D143352

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D143354
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Use std::optional instead of llvm::Optional (NFC)</title>
<updated>2023-01-14T09:25:58+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-01-14T09:25:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0a81ace0047a2de93e71c82cdf0977fc989660df'/>
<id>0a81ace0047a2de93e71c82cdf0977fc989660df</id>
<content type='text'>
This patch replaces (llvm::|)Optional&lt; with std::optional&lt;.  I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces (llvm::|)Optional&lt; with std::optional&lt;.  I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Add #include &lt;optional&gt; (NFC)</title>
<updated>2023-01-14T05:05:06+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2023-01-14T05:05:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a1fe1f5f77d48b03b76884a9b9b91a6795193ac1'/>
<id>a1fe1f5f77d48b03b76884a9b9b91a6795193ac1</id>
<content type='text'>
This patch adds #include &lt;optional&gt; to those files containing
llvm::Optional&lt;...&gt; or Optional&lt;...&gt;.

I'll post a separate patch to actually replace llvm::Optional with
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds #include &lt;optional&gt; to those files containing
llvm::Optional&lt;...&gt; or Optional&lt;...&gt;.

I'll post a separate patch to actually replace llvm::Optional with
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Use std::nullopt instead of None (NFC)</title>
<updated>2022-12-04T02:50:27+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2022-12-04T02:50:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1a36588ec64ae8576e531e6f0b49eadb90ab0b11'/>
<id>1a36588ec64ae8576e531e6f0b49eadb90ab0b11</id>
<content type='text'>
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</pre>
</div>
</content>
</entry>
</feed>
