[Mlir-commits] [mlir] 496d871 - [mlir][Python] fix liveContextMap under free-threading after #178529 (#179163)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Feb 1 21:08:56 PST 2026
Author: Maksim Levental
Date: 2026-02-02T05:08:51Z
New Revision: 496d871ff32b0d1db0f145bca8fa9fe7c0e550b7
URL: https://github.com/llvm/llvm-project/commit/496d871ff32b0d1db0f145bca8fa9fe7c0e550b7
DIFF: https://github.com/llvm/llvm-project/commit/496d871ff32b0d1db0f145bca8fa9fe7c0e550b7.diff
LOG: [mlir][Python] fix liveContextMap under free-threading after #178529 (#179163)
#178529 introduced a small bug under free-threading by bumping a
reference count (or something like that) when accessing the operand list
passed to `build_generic`. This PR fixes that.
Added:
Modified:
mlir/lib/Bindings/Python/IRCore.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp
index dda4a027f0a30..7f34343eba6c9 100644
--- a/mlir/lib/Bindings/Python/IRCore.cpp
+++ b/mlir/lib/Bindings/Python/IRCore.cpp
@@ -1671,7 +1671,7 @@ nb::object PyOpView::buildGeneric(
int segmentSpec = operandSegmentSpec[i];
if (segmentSpec == 1 || segmentSpec == 0) {
// Unpack unary element.
- const auto operand = operandList[i];
+ const nanobind::handle operand = operandList[i];
if (!operand.is_none()) {
try {
operands.push_back(getOpResultOrValue(operand));
More information about the Mlir-commits
mailing list