[Mlir-commits] [mlir] [mlir][Transforms] Dialect conversion: Context-aware type conversions (PR #140434)
Matthias Springer
llvmlistbot at llvm.org
Sun May 18 19:36:16 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);
+ }
----------------
matthias-springer wrote:
Then you wouldn't be caching anything. The point of the caching is that you don't even run the lambda. Another problem is that this would change the type converter API. The documentation says that the type conversion lambdas must be attempted in a certain order.
https://github.com/llvm/llvm-project/pull/140434
More information about the Mlir-commits
mailing list