[libc-commits] [libc] [libc] Compile the GPU functions with '-fconvergent-functions' (PR #70229)

via libc-commits libc-commits at lists.llvm.org
Wed Oct 25 10:14:04 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Joseph Huber (jhuber6)

<details>
<summary>Changes</summary>

Summary:
This patch simply adds the `-fconvergent-functions` flag to the GPU
compilation. This is in relation to the behaviour of SIMT
architectures under divergence. With the flag, we assume every function
is convergent by default and rely on the compiler's divergence analysis
to transform it if possible.

Fixes: https://github.com/llvm/llvm-project/issues/63853


---
Full diff: https://github.com/llvm/llvm-project/pull/70229.diff


1 Files Affected:

- (modified) libc/cmake/modules/LLVMLibCObjectRules.cmake (+1) 


``````````diff
diff --git a/libc/cmake/modules/LLVMLibCObjectRules.cmake b/libc/cmake/modules/LLVMLibCObjectRules.cmake
index 7caa3b2db75dd2f..cf5097e23a20453 100644
--- a/libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ b/libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -68,6 +68,7 @@ function(_get_common_compile_options output_var flags)
   if (LIBC_TARGET_ARCHITECTURE_IS_GPU)
     list(APPEND compile_options "-nogpulib")
     list(APPEND compile_options "-fvisibility=hidden")
+    list(APPEND compile_options "-fconvergent-functions")
 
     # Manually disable all standard include paths and include the resource
     # directory to prevent system headers from being included.

``````````

</details>


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


More information about the libc-commits mailing list