user-guided speculative precomputation? (my wacky ia64 idea)
Jim Wilson
wilson@specifixinc.com
Wed Apr 7 23:46:00 GMT 2004
On Tue, 2004-04-06 at 17:08, Duraid Madina wrote:
> This #pragma would be added to code such as (taken from
> http://www.intel.com/technology/itj/2002/volume06issue01/art03_specprecomp/p06_xeon.htm
There is some potential for confusion over what the pragma applies to.
In a more complex example, the following line might contain more than
one statement, or one statement might be spread over several lines, or
the next line may contain a control-flow statement like an if. In some
of these cases, it might not be clear what to do unless this is defined
well.
I think there is no hope of implementing this in the current RTL
optimizers. This would have to be done in the tree-ssa infrastructure
which is not yet in the mainline compiler, but hopefully coming soon.
The papers talk about using SMT systems, and running two threads on
different processors. This allows the two threads to run independently,
and if we can get the second thread to run ahead of the first one, then
the first one runs faster than it does without the second one.
But if we are running both threads on a single IA-64 cpu, then they are
now running in lock-step and things break down. If the second thread
stalls because of a cache miss or page fault, then the primary thread
stalls too, so now the secondary thread is slowly down the primary
thread in some cases which is undesirable. This doesn't seem to work
unless we use prefetch instructions in the secondary thread, and now we
aren't doing speculative precomputation anymore. We are just doing
simple prefetching.
> Agreed, though I trust that by "difficult packing problem" you mean a
> problem that might not be very likely to succeed
Yes. You might not be able to get rid of as many nops as you hoped
because of packing limitations.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc
mailing list