[PATCH] D43794: [InstrProfiling] Emit the runtime hook when no counters are lowered

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 11:37:23 PST 2018


vsk added a comment.

In https://reviews.llvm.org/D43794#1020233, @davidxl wrote:

> Can this be done under an option?


The change doesn't affect many programs, so istm that it's simpler to make it unconditional.

> More fundamentally, do you just need to create a reference to the runtime hook variable? Is it possible to just unconditionally emit that while keep others unchanged?

Currently all we need is a reference to the runtime hook. I can reduce the scope of this patch down to just this part, and then add a test that the exported symbol set for an empty program looks good.

> Or even better, is it possible to do the same linker trick as on linux -- to force undef of the variable on the command line?

It's possible with an option like -force_load, but this is guaranteed to break Darwin programs which intentionally circumvent the RegisterRuntime static initializer.


https://reviews.llvm.org/D43794





More information about the llvm-commits mailing list