[PATCH] D13328: [PGO]: Eliminate __llvm_profile_register calls for Linux (LLVM changes)

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 22:52:55 PDT 2015


davidxl created this revision.
davidxl added a reviewer: bogner.
davidxl added a subscriber: llvm-commits.

This is patch-2.

http://reviews.llvm.org/D13328

Files:
  lib/Transforms/Instrumentation/InstrProfiling.cpp
  test/Instrumentation/InstrProfiling/platform.ll

Index: test/Instrumentation/InstrProfiling/platform.ll
===================================================================
--- test/Instrumentation/InstrProfiling/platform.ll
+++ test/Instrumentation/InstrProfiling/platform.ll
@@ -23,7 +23,7 @@
 ;; symbols by their sections.
 
 ; MACHO-NOT: define internal void @__llvm_profile_register_functions
-; ELF: define internal void @__llvm_profile_register_functions
+; ELF-NOT: define internal void @__llvm_profile_register_functions
 
 ; MACHO-NOT: define internal void @__llvm_profile_init
-; ELF: define internal void @__llvm_profile_init
+; ELF-NOT: define internal void @__llvm_profile_init
Index: lib/Transforms/Instrumentation/InstrProfiling.cpp
===================================================================
--- lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -257,6 +257,9 @@
   if (Triple(M->getTargetTriple()).isOSDarwin())
     return;
 
+  // Use linker script magic to get data/cnts/name start/end.
+  if (Triple(M->getTargetTriple()).isOSLinux()) return;
+
   // Construct the function.
   auto *VoidTy = Type::getVoidTy(M->getContext());
   auto *VoidPtrTy = Type::getInt8PtrTy(M->getContext());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13328.36188.patch
Type: text/x-patch
Size: 1222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151001/70bc4e7a/attachment.bin>


More information about the llvm-commits mailing list