[PATCH] D46489: [HIP] Let assembler output bitcode for amdgcn

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 4 21:02:00 PDT 2018


yaxunl created this revision.
yaxunl added reviewers: rjmccall, tra.

amdgcn does not support linking of object files, therefore let
assembler output bitcode for HIP for amdgcn.


https://reviews.llvm.org/D46489

Files:
  lib/Driver/ToolChains/Clang.cpp


Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -3213,7 +3213,11 @@
         CmdArgs.push_back("-P");
     }
   } else if (isa<AssembleJobAction>(JA)) {
-    CmdArgs.push_back("-emit-obj");
+    // AMDGCN does not support linking obj files.
+    if (IsHIP && Triple.getArch() == llvm::Triple::amdgcn)
+      CmdArgs.push_back("-emit-llvm-bc");
+    else
+      CmdArgs.push_back("-emit-obj");
 
     CollectArgsForIntegratedAssembler(C, Args, CmdArgs, D);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46489.145349.patch
Type: text/x-patch
Size: 592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180505/22149522/attachment-0001.bin>


More information about the cfe-commits mailing list