jhuber6 created this revision.
jhuber6 added reviewers: JonChesterfield, jdoerfert, yaxunl, tianshilei1992.
Herald added a subscriber: inglorion.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The LTO config allows us to set whether or not the build is
freestanding. This pretty much prevents emission of library calls and
should cause them to be treated like normal functions. This is in
relation to D154364 <https://reviews.llvm.org/D154364>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154378

Files:
  clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp


Index: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
===================================================================
--- clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -570,6 +570,10 @@
   Conf.CGFileType =
       (Triple.isNVPTX() || SaveTemps) ? CGFT_AssemblyFile : CGFT_ObjectFile;
 
+  // We consider the GPU to be a freestanding target so we shouldn't emit any
+  // builtin library calls.
+  Conf.Freestanding = true;
+
   // TODO: Handle remark files
   Conf.HasWholeProgramVisibility = Args.hasArg(OPT_whole_program);
 


Index: clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
===================================================================
--- clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -570,6 +570,10 @@
   Conf.CGFileType =
       (Triple.isNVPTX() || SaveTemps) ? CGFT_AssemblyFile : CGFT_ObjectFile;
 
+  // We consider the GPU to be a freestanding target so we shouldn't emit any
+  // builtin library calls.
+  Conf.Freestanding = true;
+
   // TODO: Handle remark files
   Conf.HasWholeProgramVisibility = Args.hasArg(OPT_whole_program);
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to