On Friday, 14 October 2016 at 04:49:30 UTC, Stefan Koch wrote:
On Friday, 14 October 2016 at 04:44:46 UTC, Patrick Schluter wrote:


short and simple

core.hints ?
That sounds to weak.

I like "hints". It's immediately clear that the functions don't do anything and don't change the meaning of your program, they are just hints.

If I tell the compiler to group function a and function b together and position them as close as possible to each other it damn well better do it. Because If I went trough the trouble of determining that this has to be done.
I want to use that knowledge.

What you want is much more than what triggered this discussion.
I think for grouping functions, you'll have to fight with the linker.

If you tell the compiler to expect "true" for a certain bool expression, it can try to find a better "polarity" of cmp-jmp code. Note that expected values can propagate. If you force it to use one polarity or another, I think very quickly you'll end up having to rewrite your hints when slightly change function control-flow, e.g. by adding an if-statement that makes it more profitable to invert the polarity compared to what it was before.

Reply via email to