[PATCH] D105423: Add support for Opaque as a LowLevelType
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 7 08:17:05 PDT 2021
arsenm added a comment.
In D105423#2862010 <https://reviews.llvm.org/D105423#2862010>, @pmatos wrote:
> In D105423#2861795 <https://reviews.llvm.org/D105423#2861795>, @arsenm wrote:
>
>> I'm not sure what an opaque type means. Do you have an IR sample?
>
> Sure - for example, from how we represent externrefs (opaque object references in WebAssembly):
>
> %extern = type opaque
> %externref = type %extern addrspace(1)* ;; addrspace 1 is nonintegral
> @externref_global = local_unnamed_addr addrspace(2) global %externref undef
>
> define %externref @return_externref_global() {
> ;; this generates a global.get of @externref_global
> %ref = load %externref, %externref addrspace(2)* @externref_global
> ret %externref %ref
> }
But here it's just a pointer with an address space and you aren't actually using the opaque type as a value. Why can't you just treat this as a regular pointer?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105423/new/
https://reviews.llvm.org/D105423
More information about the llvm-commits
mailing list