Page MenuHomePhabricator

Use linker option to reference profile runtime hook (Linux)
Needs ReviewPublic

Authored by davidxl on Oct 23 2015, 3:52 PM.



Currently when profile instrumentation is on, the compiler emits a runtime hook use function (llvm_profile_runtime_use) for every module that is instrumented. The generated function references hook llvm_profile_runtime in order for linker to link in runtime initialization module (InstrProfilingRuntime.o) that registers the profile dumper atexit. The cost (though very small) can be avoided by changing the driver to emit the right linker option.

The clang patch itself does not change any functionality. There will be a follow up patch in LLVM that disables the hook use emission once this one is committed.

Diff Detail

Event Timeline

davidxl updated this revision to Diff 38272.Oct 23 2015, 3:52 PM
davidxl retitled this revision from to Use linker option to reference profile runtime hook (Linux).
davidxl updated this object.
davidxl added a reviewer: bogner.
davidxl added a subscriber: cfe-commits.
vsk added a subscriber: vsk.Oct 25 2015, 11:21 PM
vsk added a comment.Oct 26 2015, 8:44 AM

This looks good to me. Does this mean we will get rid of getInstrProfRuntimeHookVarUseFuncName?