[Mlir-commits] [mlir] [mlir] Add the concept of ASM dialect aliases (PR #86033)

Fabian Mora llvmlistbot at llvm.org
Thu Mar 28 09:11:22 PDT 2024


fabianmcg wrote:

> The `addDialectAlias` would simply be an alternative way to later give the printer the information that it has to check whether a `Ptr::PointerType` is an instance of `LLVMPointerType` or not prior to deciding which dialect to use when printing

The problem here is that we would need something like:
```
DenseMap<TypeID, SmallVector<Dialect*>> aliasedTypes;
// Or
DenseMap<TypeID, SmallVector<llvm::function_ref<Dialect*(Type)>>> aliasedTypes;
```
In `AsmPrinter` and every time a type gets printed we would need to check it, which would kill performance. This issue appears because only the alias knows how to distinguish itself from the base type. 

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


More information about the Mlir-commits mailing list