[llvm] b8a7d81 - [LLVM] Fix incorrect GPU triple detection for runtimes builds

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 05:32:11 PST 2024


Author: Joseph Huber
Date: 2024-02-23T07:32:03-06:00
New Revision: b8a7d8131e5ad2c21238e192e6f9c5b69512abe3

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

LOG: [LLVM] Fix incorrect GPU triple detection for runtimes builds

Summary:
This block of code is used to prevent a GPU-based cross compiling build
from taking incompatible arguments. However this incorrectly used the
LLVM default triple instead of the runtimes target. Fix that so the bots
can continue to default the triple to NVPTX.

Added: 
    

Modified: 
    llvm/cmake/modules/HandleLLVMOptions.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 40316b11ceed9b..08ff49ded57a14 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -120,10 +120,10 @@ if( LLVM_ENABLE_ASSERTIONS )
   endif()
 endif()
 
-# If we are targeting a GPU architecture we want to ignore all the standard
-# flag handling.
-if("${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^amdgcn" OR
-   "${LLVM_DEFAULT_TARGET_TRIPLE}" MATCHES "^nvptx64")
+# If we are targeting a GPU architecture in a runtimes build we want to ignore
+# all the standard flag handling.
+if("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn" OR
+   "${LLVM_RUNTIMES_TARGET}" MATCHES "^nvptx64")
   return()
 endif()
 


        


More information about the llvm-commits mailing list