1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[instrprof] Use __{start,stop}_SECNAME on PS4 too.

Summary:
The PS4 linker seems to handle this fine.

Hi David, it seems that indeed most ELF linkers support
__{start,stop}_SECNAME, as our proprietary linker does as well.

This follows the pattern of r250679 w.r.t. the testing.

Maggie, Phillip, Paul: I've tested this with the PS4 SDK 3.5 toolchain
prerelease and it seems to work fine.

Reviewers: davidxl

Subscribers: probinson, phillip.power, MaggieYi

Differential Revision: http://reviews.llvm.org/D17672

llvm-svn: 262112
This commit is contained in:
Sean Silva 2016-02-27 06:01:26 +00:00
parent 5bc3e758d6
commit 460bbafe5e
2 changed files with 6 additions and 1 deletions

View File

@ -406,7 +406,8 @@ void InstrProfiling::emitRegistration() {
// Use linker script magic to get data/cnts/name start/end. // Use linker script magic to get data/cnts/name start/end.
if (Triple(M->getTargetTriple()).isOSLinux() || if (Triple(M->getTargetTriple()).isOSLinux() ||
Triple(M->getTargetTriple()).isOSFreeBSD()) Triple(M->getTargetTriple()).isOSFreeBSD() ||
Triple(M->getTargetTriple()).isPS4CPU())
return; return;
// Construct the function. // Construct the function.

View File

@ -3,6 +3,7 @@
; RUN: opt < %s -mtriple=x86_64-apple-macosx10.10.0 -instrprof -S | FileCheck %s -check-prefix=MACHO ; RUN: opt < %s -mtriple=x86_64-apple-macosx10.10.0 -instrprof -S | FileCheck %s -check-prefix=MACHO
; RUN: opt < %s -mtriple=x86_64-unknown-linux -instrprof -S | FileCheck %s -check-prefix=LINUX ; RUN: opt < %s -mtriple=x86_64-unknown-linux -instrprof -S | FileCheck %s -check-prefix=LINUX
; RUN: opt < %s -mtriple=x86_64-unknown-freebsd -instrprof -S | FileCheck %s -check-prefix=FREEBSD ; RUN: opt < %s -mtriple=x86_64-unknown-freebsd -instrprof -S | FileCheck %s -check-prefix=FREEBSD
; RUN: opt < %s -mtriple=x86_64-scei-ps4 -instrprof -S | FileCheck %s -check-prefix=PS4
; RUN: opt < %s -mtriple=x86_64-pc-solaris -instrprof -S | FileCheck %s -check-prefix=SOLARIS ; RUN: opt < %s -mtriple=x86_64-pc-solaris -instrprof -S | FileCheck %s -check-prefix=SOLARIS
@__profn_foo = hidden constant [3 x i8] c"foo" @__profn_foo = hidden constant [3 x i8] c"foo"
@ -15,6 +16,7 @@
; MACHO: @__profd_foo = hidden {{.*}}, section "__DATA,__llvm_prf_data", align 8 ; MACHO: @__profd_foo = hidden {{.*}}, section "__DATA,__llvm_prf_data", align 8
; LINUX: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8 ; LINUX: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8
; FREEBSD: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8 ; FREEBSD: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8
; PS4: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8
; SOLARIS: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8 ; SOLARIS: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8
; ELF: @__llvm_prf_nm = private constant [{{.*}} x i8] c"{{.*}}", section "{{.*}}__llvm_prf_names" ; ELF: @__llvm_prf_nm = private constant [{{.*}} x i8] c"{{.*}}", section "{{.*}}__llvm_prf_names"
@ -32,9 +34,11 @@ declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
; MACHO-NOT: define internal void @__llvm_profile_register_functions ; MACHO-NOT: define internal void @__llvm_profile_register_functions
; LINUX-NOT: define internal void @__llvm_profile_register_functions ; LINUX-NOT: define internal void @__llvm_profile_register_functions
; FREEBSD-NOT: define internal void @__llvm_profile_register_functions ; FREEBSD-NOT: define internal void @__llvm_profile_register_functions
; PS4-NOT: define internal void @__llvm_profile_register_functions
; SOLARIS: define internal void @__llvm_profile_register_functions ; SOLARIS: define internal void @__llvm_profile_register_functions
; MACHO-NOT: define internal void @__llvm_profile_init ; MACHO-NOT: define internal void @__llvm_profile_init
; LINUX-NOT: define internal void @__llvm_profile_init ; LINUX-NOT: define internal void @__llvm_profile_init
; FREEBSD-NOT: define internal void @__llvm_profile_init ; FREEBSD-NOT: define internal void @__llvm_profile_init
; PS4-NOT: define internal void @__llvm_profile_init
; SOLARIS: define internal void @__llvm_profile_init ; SOLARIS: define internal void @__llvm_profile_init