[libc-commits] [clang] [libc] [libc][clang] Use __nvvm_nanosleep builtin over inline assembly (PR #198815)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri May 22 12:52:24 PDT 2026


jhuber6 wrote:

> maybe with `__has_builtin` instead of `__nvvm_reflect`?

That would have the effect of disabling it. The nvvm_reflect thing is a big hack and there's been a lot of discussion around it in the past, but basically it turns a compile time check into a runtime one, so one IR file can 'do the optimal thing' on a sufficiently new GPU. AMDGCN recently added some `__builtin_amdgcn_is_invocable` or something which does something similar, but it's only slightly less hacky.

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


More information about the libc-commits mailing list