Optimization of conditional access to globals: thread-unsafe?
David Miller
davem@davemloft.net
Mon Oct 29 03:04:00 GMT 2007
From: "Dave Korn" <dave.korn@artimi.com>
Date: Mon, 29 Oct 2007 02:39:15 -0000
> BTW, you and Tomash should get your stories in synch. He says
> speculative loads are ok, just no stores, and wants a kind of
> half-volatile flag that would only suppress stores. I think you're
> already looking one step further down the road than he is and have
> realised that speculative loads will give you problems too.
Probably speculative loads are OK, as long as function calls
to functions the compiler cannot see the complete implementation
of form an implicit boundary (ie. any memory might be modified)
which is happily does already.
In what cases those speculative loads are profitable is another
matter, given how expensive cache misses are compared to mispredicted
branches.
More information about the Gcc
mailing list