[libc-commits] [libc] e33f8ac - [libc] Fix inline assembly for nvptx quick_exit

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Thu Mar 23 09:28:48 PDT 2023


Author: Joseph Huber
Date: 2023-03-23T11:28:33-05:00
New Revision: e33f8ac9d8b3bd8b376d2306c3988381309b68eb

URL: https://github.com/llvm/llvm-project/commit/e33f8ac9d8b3bd8b376d2306c3988381309b68eb
DIFF: https://github.com/llvm/llvm-project/commit/e33f8ac9d8b3bd8b376d2306c3988381309b68eb.diff

LOG: [libc] Fix inline assembly for nvptx quick_exit

Summary:
The `exit` function in NVPTX has no intrinsic, but the assembly requires
a semicolon in the ptx, otherwise it will fail.

Added: 
    

Modified: 
    libc/src/__support/OSUtil/gpu/quick_exit.cpp

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/OSUtil/gpu/quick_exit.cpp b/libc/src/__support/OSUtil/gpu/quick_exit.cpp
index 56f0427c8d81..3fab438a357a 100644
--- a/libc/src/__support/OSUtil/gpu/quick_exit.cpp
+++ b/libc/src/__support/OSUtil/gpu/quick_exit.cpp
@@ -27,7 +27,7 @@ void quick_exit(int status) {
       [](rpc::Buffer *) { /* void */ });
 
 #if defined(LIBC_TARGET_ARCH_IS_NVPTX)
-  asm("exit" ::: "memory");
+  asm("exit;" ::: "memory");
 #elif defined(LIBC_TARGET_ARCH_IS_AMDGPU)
   // This will terminate the entire wavefront, may not be valid with divergent
   // work items.


        


More information about the libc-commits mailing list