[llvm-branch-commits] [flang] [mlir] [mlir][LLVM] Replace `llvm::LLVMPointerType` by `ptr::PtrType` (PR #173094)

Fabian Mora via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Dec 20 12:24:47 PST 2025


fabianmcg wrote:

> To me it does not "keep things simple", it makes things misleading: something that is prefixed `!llvm` should be a LLVM type.

In this case, I would argue it's an LLVM specific type alias, and as such it makes sense to be prefixed `!llvm`. If a dialect consider useful such aliases, and the aliased type is in the dependent dialects I don't see what is the issue for short hands. We already allow a limited form with OpAsmDialect aliases.

> For readability, the LLVM operations can print simply `ptr<3>` if they wish so. (even better if we get rid of the numbers here, like LLVM is trying to do right now)

Getting rid of the numbers should be possible in the short term. But, replacing `!llvm.ptr` with `!ptr.ptr` is starting to be in the critical path for all of these changes to not have hacky solutions.

Finally, the motivation to preserve `!llvm.ptr` and `LLVMPointerType` is to make the transition less painful and more gradual. I'd hope that in the future, we could phase out things like `LLVMPointerType`.

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


More information about the llvm-branch-commits mailing list