user-guided speculative precomputation? (my wacky ia64 idea)

James Morrison ja2morri@csclub.uwaterloo.ca
Wed Apr 7 01:54:00 GMT 2004


Duraid Madina <duraid@octopus.com.au> writes:
> This #pragma would be added to code such as (taken from
> http://www.intel.com/technology/itj/2002/volume06issue01/art03_specprecomp/p06_xeon.htm
> )
> 
> {
> 	n = NodeArray[0];
> 	while(n && remaining)
> 	{
> 		doSomeWork();
> #pragma delinquent_load
> 		n->i = n->next->j + n->next->k + n->next->l;
> 		n = n->next;
> 		remaining--;
> 	}
> }
> 

 I'm not sure if I should be scared by this example or put it up to lazyness.
However, n is going to be compared each time we go through the loop even
though it is only supposed to be tested once.  If n is ever 0 at the top of
the loop, after executing the loop, then a segfault would have already occured.
I don't suppose it's possible to optimize this, is it?

Jim



More information about the Gcc mailing list