[Mlir-commits] [mlir] [MLIR][Python] Fix GIL handling in verification and printing (PR #215848)

Maksim Levental llvmlistbot at llvm.org
Thu Aug 13 12:46:51 PDT 2026


makslevental wrote:

@hahalfx thanks for the investigation. I still haven't had time to look at this closely (though I did skim your current summary). Just gonna paste here what I told @PragmaTwice offline:

The problem is the c++ back to python call isn't the common cse. In this specific case obviously most users don't have verifiers written in python. So if you put explicitly do GIL manipulation you're pessimizing the common path. My preference would be to just warn people about the sharp edge ehre: if you have Python callbacks then you need to turn off multithreading. Or at minimum make the GIL optional in those APIs (via a param/flag).

But I'll come back soon.


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


More information about the Mlir-commits mailing list