[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:42 PDT 2025


https://github.com/zero9178 approved this pull request.

LGTM, but please wait for either @j2kun or @ZenithalHourlyRate to be happy as well.

Disabling all caching seems unfortunate to me but expected. Maybe in a future PR this could be more fine grained such that the algorithm is:
```
cache = true
foreach conversion in reverse(conversions):
   if is_context_aware(conversion):
      cache = false
   result = conversion(value)
   ... // as before

if cache:
   cacheMap[type(value)] = result
```
It should be safe to cache any type/value before the type-aware conversion was queried. We could then also document and recommend users to add type-aware conversions last.

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


More information about the Mlir-commits mailing list