This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 57896f6af7 [FFI] Bump tvm-ffi for StructuralMap policy (#20299)
57896f6af7 is described below

commit 57896f6af706f2587492a90f49fd19d742b81251
Author: Tianqi Chen <[email protected]>
AuthorDate: Wed Sep 9 20:13:52 2026 -0400

    [FFI] Bump tvm-ffi for StructuralMap policy (#20299)
    
    Update tvm-ffi to c5e636b, whose default descent owns StructuralMap
    remapping. Cache unchanged Var definition results as markers so later
    uses preserve the rewritten-result protocol.
---
 3rdparty/tvm-ffi |  2 +-
 src/ir/expr.cc   | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/3rdparty/tvm-ffi b/3rdparty/tvm-ffi
index 39d593e716..c5e636bbfb 160000
--- a/3rdparty/tvm-ffi
+++ b/3rdparty/tvm-ffi
@@ -1 +1 @@
-Subproject commit 39d593e716a5b437a57ea3241aff8850112caf2e
+Subproject commit c5e636bbfb097cca610acee841e26d751d47a63b
diff --git a/src/ir/expr.cc b/src/ir/expr.cc
index ff3eccde77..1af350c70d 100644
--- a/src/ir/expr.cc
+++ b/src/ir/expr.cc
@@ -311,7 +311,7 @@ TVMFFIAny VarMutate(ffi::StructuralMutatorObj* mutator, 
ffi::AnyView value) noex
     return ffi::Unchanged().CopyToTVMFFIAny();
   }
   ffi::UnchangedOr<ffi::Any> result = ffi::Unchanged();
-  ffi::Any mapped_value;
+  ffi::Any mapped_value = ffi::Unchanged();
   // A PrimType carries only a dtype, so it has nothing to substitute.  Broad 
callbacks do not see
   // this skipped field; dynamically typed Vars still descend through the Type 
value.
   if (!self->ty.as<PrimTypeNode>()) {
@@ -331,8 +331,7 @@ TVMFFIAny VarMutate(ffi::StructuralMutatorObj* mutator, 
ffi::AnyView value) noex
     }
   }
   if (!result.IsUnchanged() || mutator->def_region_kind() == 
kTVMFFIDefRegionKindPattern) {
-    ffi::AnyView value_to_store = result.IsUnchanged() ? value : 
ffi::AnyView(mapped_value);
-    auto set_result = mutator->VarRemapSetExpected(value, value_to_store);
+    auto set_result = mutator->VarRemapSetExpected(value, mapped_value);
     if (TVM_FFI_PREDICT_FALSE(set_result.is_err())) {
       return 
ffi::details::AnyUnsafe::MoveAnyToTVMFFIAny(ffi::Any(std::move(set_result).error()));
     }
@@ -354,7 +353,7 @@ TVMFFIAny VarMaybeInplaceMutate(ffi::StructuralMutatorObj* 
mutator, ffi::AnyView
     return ffi::Unchanged().CopyToTVMFFIAny();
   }
   ffi::UnchangedOr<ffi::Any> result = ffi::Unchanged();
-  ffi::Any mapped_value;
+  ffi::Any mapped_value = ffi::Unchanged();
   // A PrimType carries only a dtype, so it has nothing to substitute.  Broad 
callbacks do not see
   // this skipped field; dynamically typed Vars still descend through the Type 
value.
   if (!self->ty.as<PrimTypeNode>()) {
@@ -374,8 +373,7 @@ TVMFFIAny VarMaybeInplaceMutate(ffi::StructuralMutatorObj* 
mutator, ffi::AnyView
     }
   }
   if (!result.IsUnchanged() || mutator->def_region_kind() == 
kTVMFFIDefRegionKindPattern) {
-    ffi::AnyView value_to_store = result.IsUnchanged() ? value : 
ffi::AnyView(mapped_value);
-    auto set_result = mutator->VarRemapSetExpected(value, value_to_store);
+    auto set_result = mutator->VarRemapSetExpected(value, mapped_value);
     if (TVM_FFI_PREDICT_FALSE(set_result.is_err())) {
       return 
ffi::details::AnyUnsafe::MoveAnyToTVMFFIAny(ffi::Any(std::move(set_result).error()));
     }

Reply via email to