[llvm] [ELF] Correctly set the `nvptx` triple from `makeTriple()` (PR #76970)
    Joseph Huber via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Jan  5 10:20:45 PST 2024
    
    
  
================
@@ -1349,6 +1349,13 @@ template <class ELFT> Triple::ArchType ELFObjectFile<ELFT>::getArch() const {
     return Triple::UnknownArch;
   }
 
+  case ELF::EM_CUDA: {
+    if (EF.getHeader().e_ident[ELF::EI_CLASS] == ELF::ELFCLASS32)
+      return Triple::nvptx;
+    else
+      return Triple::nvptx64;
----------------
jhuber6 wrote:
There weren't any existing tests for any of this code, so I just punted it until the second patch. Thanks, I'll do the NFC.
https://github.com/llvm/llvm-project/pull/76970
    
    
More information about the llvm-commits
mailing list