From c55d87cc0391368d1bfeff4ad18bc8a69644e52b Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Mon, 5 Aug 2024 09:20:27 -0500 Subject: [PATCH] [FFI] Remove backwards-compatibility unwrapping of IntImm This is a follow-up PR to https://github.com/apache/tvm/pull/16183, which updated the FFI with explicit integer types. As part of that change, many internal functions were updated to accept non-IR types (e.g. `Array` instead of `Array`). For backwards compatibility with callees that provided the IR types, a specialization of `PackedFuncValueConverter` unwrapped the `IntImm` into a `runtime::Int`. This commit removes the backwards-compatibility specialization of `PackedFuncValueConverter`. Breakages that are found in CI as a result will then be updated at the caller side, removing the need for the backwards-compatibility handler altogether. --- include/tvm/ir/expr.h | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/include/tvm/ir/expr.h b/include/tvm/ir/expr.h index efde52385177e..6c81f06561d27 100644 --- a/include/tvm/ir/expr.h +++ b/include/tvm/ir/expr.h @@ -866,28 +866,6 @@ struct PackedFuncValueConverter { } }; -/* \brief Backwards compatibility wrapper for IntImm arguments - * - * In previous versions of TVM, IntImm was the default FFI type for - * integer arguments, instead of runtime::Int. For backwards - * compatibility where the callee has been updated to expected a - * runtime::Int, the caller has not been updated to provide a - * runtime::Int (e.g. relay script parsing), and the auto-unboxing of - * runtime::Int does not apply (e.g. making an `Array`), - * allow the IntImm to be generated. - */ -template <> -struct PackedFuncValueConverter { - template - static runtime::Int From(const PODSubclass& val) { - if (val.template IsObjectRef()) { - return runtime::Int(val.template AsObjectRef()->value); - } else { - return val.template AsObjectRef(); - } - } -}; - } // namespace runtime } // namespace tvm