[libc-commits] [PATCH] D157323: [libc] Allow NVPTX to use aliases

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Aug 7 13:14:23 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: tra, jdoerfert, sivachandra, michaelrj, JonChesterfield.
Herald added subscribers: libc-commits, mattd, gchakrabarti, asavonic, jeroen.dobbelaere.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.
Herald added a subscriber: wangpc.

Summrary:
Following D156014 <https://reviews.llvm.org/D156014> we can now use aliases for NVPTX, removing this source
of divergence. We require at least +ptx63 and at least sm_30 for
`.alias` but this is already within what we build for with `libc`
support.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157323

Files:
  libc/src/__support/common.h


Index: libc/src/__support/common.h
===================================================================
--- libc/src/__support/common.h
+++ libc/src/__support/common.h
@@ -16,14 +16,8 @@
 #define LLVM_LIBC_FUNCTION_ATTR
 #endif
 
-// The NVPTX target does not support aliasing.
-#if defined(LIBC_COPT_PUBLIC_PACKAGING) && defined(LIBC_TARGET_ARCH_IS_NVPTX)
-#define LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)                           \
-  LLVM_LIBC_FUNCTION_ATTR decltype(__llvm_libc::name)                          \
-      __##name##_impl__ __asm__(#name);                                        \
-  type __##name##_impl__ arglist
 // MacOS needs to be excluded because it does not support aliasing.
-#elif defined(LIBC_COPT_PUBLIC_PACKAGING) && (!defined(__APPLE__))
+#if defined(LIBC_COPT_PUBLIC_PACKAGING) && (!defined(__APPLE__))
 #define LLVM_LIBC_FUNCTION_IMPL(type, name, arglist)                           \
   LLVM_LIBC_FUNCTION_ATTR decltype(__llvm_libc::name)                          \
       __##name##_impl__ __asm__(#name);                                        \


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157323.547922.patch
Type: text/x-patch
Size: 1085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230807/caaddce2/attachment.bin>


More information about the libc-commits mailing list