[Clang][CodeGen] `__builtin_alloca`s should care about address spaces
`alloca` instructions always return pointers to the `alloca` address space. This composes poorly with most HLLs which are address space agnostic and thus have all pointers point to generic/default. Static `alloca`s were already handled on the AST level, however dynamic `alloca`s were not, which would lead to subtly incorrect IR. This patch addresses that by inserting an address space cast iff the `alloca` address space is different from the default / expected. Reviewed By: rjmccall, arsenm Differential Revision: https://reviews.llvm.org/D156539
Loading
Please sign in to comment