[clang] [llvm] [AMDGPU] Implement variadic functions by IR lowering (PR #93362)

Jon Chesterfield via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 1 15:56:26 PDT 2024


JonChesterfield wrote:

Finally managed to reproduce the libc failure. Thanks to Joseph for helping debug through the cmake. This patch as written was too optimistic about addrspacecast, a significantly more paranoid version behaves correctly (i.e. all the libc tests pass, this patch can be amended to enable the variadic ones on amdgpu). Libc tests don't seem to pick up changes to clang without a clean build (i.e. delete the whole build tree).

The memory error was on the dereference implied by va_arg. Valid addresses (read as void*) have a high bit pattern of 00002..... and invalid ones of fffff....., I'm unsure what that implies. I note that https://llvm.org/docs/AMDGPUUsage.html doesn't say much about the semantics of addrspace.

Trying to isolate that further. The error is definitely in the amdgpu-specific addrspace handling part though, the target agnostic part worked as intended.

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


More information about the cfe-commits mailing list