[Mlir-commits] [mlir] [mlir][Transforms] Dialect conversion: Context-aware type conversions (PR #140434)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun May 18 18:05:28 PDT 2025


================
@@ -2899,6 +2899,28 @@ LogicalResult TypeConverter::convertType(Type t,
   return failure();
 }
 
+LogicalResult TypeConverter::convertType(Value v,
+                                         SmallVectorImpl<Type> &results) const {
+  assert(v && "expected non-null value");
+
+  // If this type converter does not have context-aware type conversions, call
+  // the type-based overload, which has caching.
+  if (!hasContextAwareTypeConversions) {
+    return convertType(v.getType(), results);
+  }
----------------
cchen435 wrote:

Can `SmallVector<ConversionCallbackFn, 4> conversions;` be separated into one for regular type-based conversions and one for value-based conversion? In such case, there is potentially no need to disable the caching for type-based conversions. 

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


More information about the Mlir-commits mailing list