Andrew Lentvorski wrote:
Christopher Smith wrote:

Actually, C++ compilers/runtimes have basically the same option
available to them, and a number of them do actually take advantage of it.

I don't think so.  I'm going to call "gimme a reference" on that one.
Ever tried to debug some C++ code that gcc's had half a chance to optimize? GDB jumps back and forth between lines as you step through, because the instruction ordering is all out of sequence.

GCC has had an interblock scheduler that IBM's Haifa Lab donated (originally to egcs IIRC) since '97, and they've moved *way* past that since then (not to mention the SSA work which is opening up whole new possibilities).

http://august.penguin.org.il/AUG4/august_penguin4.pdf

GCC's instruction scheduler has been considered behind other C++ compilers for at least half a dozen years, so that gives you a fairly good idea of what the lay of the land is. I can't find any great links on all this, but here's a couple of basic ones:

http://findarticles.com/p/articles/mi_m0ISJ/is_2_44/ai_n14707717/pg_12
http://sysrun.haifa.il.ibm.com/hrl/greps2007/papers/greps-07-sched.pdf
The problem is pointer aliasing. The moment a pointer gets involved the sequence points *must* occur in order.

Well, lots of C++ compilers support "restrict", but also the Blitz++ guys found all kinds of ways to clue the compiler in to what is going on. You may recall that the egcs project was started around doing better alias analysis (amongst other things).

--Chris

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to