no noalias not negligible
Wayne A. Christopher
faustus at ic.Berkeley.EDU
Wed May 25 06:42:47 AEST 1988
In article <4152 at haddock.ISC.COM>, karl at haddock.ISC.COM (Karl Heuer) writes:
> >How about adding a test before the for loop? Something like:
> >#define overlap(x,y,n) (!(x + n <= y || y + n <= x))
> > if (overlap(dx, dy, n))
> > return complain("overlapping arrays\n");
> >
> >Now a smart compiler can figure out that dx, dy don't overlap ...
>
> The information is there, and a human reader can prove it, but I don't think
> they make compilers that smart yet.
The compler doesn't have to see it. Probably a better way of saying it is
that the compiler will translate
<conservative, un-optimized code>
into
if ( <conditions like noalias hold> ) {
<highly-optimized, vectorized code>
} else {
<conservative, un-optimized code>
}
Are there any constructs that couldn't be figured out at run-time without a
large penalty? Maybe if you were re-directing through an array of pointers...
Wayne
More information about the Comp.lang.c
mailing list