I wish to mark a function for more aggressive optimizations. The function is not called often, so PGO won't help, but I still want it as low latency as possible.
gcc has attribute hot for this. Is there some clang equivalent I'm missing?
BTW clang does accept __attribute__((hot)), but AFAICT it has zero impact (and is undocumented). Probably for source compatibility with gcc.
(Writing an answer instead of deleting, in case it is of use to others)
So turns out that since December 2020 Clang does support __attribute__((hot)), they just didn't document it. I nudged them. When tested in a newer clang version I see a difference in binaries.
BTW they did support __attribute__((cold)) long before that. And as I suspected, the clang front end did accept hot for sake of gcc compatibility.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With