Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,7 @@ bool InstrProfiling::emitRuntimeHook() {
GlobalValue::LinkOnceODRLinkage,
getInstrProfRuntimeHookVarUseFuncName(), M);
User->addFnAttr(Attribute::NoInline);
User->addFnAttr(Attribute::OptimizeNone);
if (Options.NoRedZone)
User->addFnAttr(Attribute::NoRedZone);
User->setVisibility(GlobalValue::HiddenVisibility);
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/Instrumentation/InstrProfiling/profiling.ll
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
; COFF: @llvm.compiler.used = appending global {{.*}} @__llvm_profile_runtime_user {{.*}} @__profd_foo {{.*}}
; XCOFF: @llvm.used = appending global {{.*}} @__llvm_profile_runtime_user {{.*}} @__profd_foo {{.*}}

; MACHO: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} {
; MACHO: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() [[ATTRS:#[0-9]+]] {
; MACHO: %[[REG:.*]] = load i32, i32* @__llvm_profile_runtime
; MACHO: ret i32 %[[REG]]
; MACHO: }
; MACHO: [[ATTRS]] = {{.*}}optnone
; COFF: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} comdat {
; ELF-NOT: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} {
; ELF-NOT: %[[REG:.*]] = load i32, i32* @__llvm_profile_runtime
Expand Down