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

Markus Böck llvmlistbot at llvm.org
Sun May 18 02:13:43 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);
+  }
----------------
zero9178 wrote:

```suggestion
  if (!hasContextAwareTypeConversions)
    return convertType(v.getType(), results);
```

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


More information about the Mlir-commits mailing list