Boost logo

Boost :

Subject: Re: [boost] [review] **NEXT WEEK** Review of Outcome (starts Fri-19-May)
From: Soul Studios (matt_at_[hidden])
Date: 2017-05-14 23:05:50

>> If you are referring to a cross-platform implementation of
>> __builtin_expect that uses regular C++ then you have my full support,
>> you should propose such a library. As a Visual C++ user I would find
>> that very helpful!!searchin/sg14/likely/sg14/jU82E1n2WPE/6py5KioTFAAJ

There's one here. I don't think VCC supports any form of real branch
hinting at present though :)

> There was a very interesting talk at ACCU (unfortunately in the
> non-videoed room) by a HFT guy explaining all the ways in which recent
> GCC versions have bugged __builtin_expect, like inverting the code path
> you specifically told the compiler was the hot path.

That kind of thing certainly matches my experience of using it - there
are situations where my code was 99.9999% hot path, but somehow
utilizing builtin_expect made benchmarks worse, assumably by mucking up
the optimization code.

> But I can see a feature like __builtin_expect that going the way of the
> dodo as the compiler vendors really would prefer if you used profile
> guided optimisation instead. Passing that sort of micro-info from the
> parser to the backend is surely complex to get right.

Unfortunately that would not be kosher for fields like AAA gamedev,
where you're talking massive codebases compiling into singular files
where PGO is not acceptable because user behaviour is not predictable.
And, in my experience, PGO success varieis wildly from compiler to
compiler (VCC2013's was a pessimisation feature - even with simple,
repeatable benchmark code).

Boost list run by bdawes at, gregod at, cpdaniel at, john at