Standard way to supply hints to branches

Zoadian no at no.no
Fri Sep 13 11:18:59 UTC 2024


On Friday, 13 September 2024 at 10:57:56 UTC, Quirin Schroll 
wrote:
> On Friday, 13 September 2024 at 10:26:48 UTC, Richard (Rikki) 
> Andrew Cattermole wrote:
> Let’s say you have a big switch in a hot loop. You profiled and 
> now the data tells you how likely each branch was. What would 
> you prefer? Reordering the branches by likelihood, leading to a 
> diff that’s basically impossible to understand or even vet that 
> it’s just a reordering, or the pure addition of likelihood 
> annotations, for which in the diff it’s absolutely clear 
> nothing else changes. And if there’s a fallthrough, you have to 
> jump to the right case now.

i'd prefer handing the compiler a profile log, and the compiler 
just optimizing based on that file without the need to do any 
annotations by hand.




More information about the Digitalmars-d mailing list