[PATCH] D149215: [MemProf] Control availability of hot/cold operator new from LTO link

Peter Collingbourne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 27 13:52:14 PDT 2023


pcc added a comment.

In D149215#4303197 <https://reviews.llvm.org/D149215#4303197>, @tejohnson wrote:

> In D149215#4303149 <https://reviews.llvm.org/D149215#4303149>, @pcc wrote:
>
>>> Adds an LTO option
>>
>> Usual question: does it need to be an option? Could the allocator expose a symbol such as `__malloc_hot_cold` that the linker could check for in the symbol table?
>
> I thought about doing something like that, but the disadvantage is that it requires support in the linkers (presumably at least both lld and the gold plugin), instead of being centralized in LTO itself. That being said, I do see existing lld code that currently looks for certain special __* symbols, so maybe this would be ok. I agree it would be nice to have something automatic, at least longer term. However, I think we need the internal option anyway, for testing (especially via opt for simulating regular LTO). What do you think of my adding a TODO to investigate the approach you are suggesting here?

That's fine.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149215/new/

https://reviews.llvm.org/D149215



More information about the cfe-commits mailing list