OpaquePtr: Don't check pointee type for byval/preallocated
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 26 Jun 2020 15:36:22 +0000 (11:36 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 9 Jul 2020 13:37:41 +0000 (09:37 -0400)
commit6f5d9136b27eefc981333d8c23ea9c0a38033d7b
treead0938f22174bbd6c86feb0f61eab9d4a375b3a8
parentd12d0b73f1c9c3a711c5cc15266a2b493cd712e9
OpaquePtr: Don't check pointee type for byval/preallocated

Since none of these users really care about the actual type, hide the
type under a new size-getting attribute to go along with
hasPassPointeeByValueAttr. This will work better for the future byref
attribute, which may end up only tracking the byte size and not the IR
type.

We currently have 3 parameter attributes that should carry the type
(technically inalloca does not yet). The APIs are somewhat awkward
since preallocated/inalloca piggyback on byval in some places, but in
others are treated as distinct attributes. Since these are all
mutually exclusive, we should probably just merge all the attribute
infrastructure treating these as totally distinct attributes.
llvm/include/llvm/IR/Argument.h
llvm/lib/IR/Function.cpp
llvm/lib/IR/Mangler.cpp