[PATCH] D57829: [HIP] Disable emitting llvm.linker.options in device compilation

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 6 10:53:32 PST 2019


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

HIP toolchain does not support llvm.linker.options in device compilation, therefore disable it.


https://reviews.llvm.org/D57829

Files:
  lib/CodeGen/CodeGenModule.cpp
  test/CodeGenCUDA/linker-options.cu


Index: test/CodeGenCUDA/linker-options.cu
===================================================================
--- /dev/null
+++ test/CodeGenCUDA/linker-options.cu
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -emit-llvm -o - -fcuda-is-device -x hip %s | FileCheck %s
+
+// CHECK-NOT: llvm.linker.options
+#pragma comment(lib, "a.so")
Index: lib/CodeGen/CodeGenModule.cpp
===================================================================
--- lib/CodeGen/CodeGenModule.cpp
+++ lib/CodeGen/CodeGenModule.cpp
@@ -438,6 +438,7 @@
     SanStats->finish();
 
   if (CodeGenOpts.Autolink &&
+      !(Context.getLangOpts().CUDAIsDevice && Context.getLangOpts().HIP) &&
       (Context.getLangOpts().Modules || !LinkerOptionsMetadata.empty())) {
     EmitModuleLinkOptions();
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57829.185589.patch
Type: text/x-patch
Size: 763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190206/1c26116a/attachment.bin>


More information about the cfe-commits mailing list