[comp.compilers] No Aliasing Compile Option

markro@microsoft.UUCP (Mark ROBERTS) (05/26/90)

In article <1913@cod.NOSC.MIL> bmarsh@cod.nosc.mil.UUCP (William C. Marsh) writes:
>In article <265861D7.3293@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes:
>>Now, if the compiler determines on its own that no aliasing is
>>possible, and then does the optimization on its own, then more power
>>to it.  That's great, because it will work for the individual routines
>>in my code in which no aliasing occurs.  But MSC isn't that smart yet.
>
>I don't beleive *any* compiler could be that smart.  Any routine that was
>passed a pointer couldn't use any global or static data, for fear that it
>is being aliased by the pointer.  The compiler, unless it looks at all the
>code (and all the possible ways of calling that function) could not possibly
>do this kind of optimization on it's own.

Actually, it is possible to do a pretty decent job of alias analysis; it is
just very computationaly expensive.  We have been investigating some
possibilities as an outgrowth of our interprocedural optimization research and
have developed an algorithm we think will work. Unfortunately, it is order n
to the power you don't even want to think about. And assumes an underlying
full interprocedural analysis to boot.

For now I think we're stuck with some sort of 'relax aliasing' option for
those wanting to get the most out of their compiler and willing to cooperate a
little bit with it.

[Now Preston can give us his 'why I like Fortran' spiel ;-) ]

Mark Roberts
{uw-beaver|uunet}!microsoft!markro
-- 
Send compilers articles to compilers@esegue.segue.boston.ma.us
{spdcc | ima | lotus}!esegue.  Meta-mail to compilers-request@esegue.
Please send responses to the author of the message, not the poster.

larus@primost.cs.wisc.edu (James Larus) (05/29/90)

Let me stick in a plug for some work that I've done recently.  Univ. of
Wisconsin Computer Science Tech Report #929** contains some measurements of
6 C programs (including gcc).  The measurements were done to estimate the
potential parallelism of the programs, but as a side-effect, I measured the
number and type of loop-carried data dependences in the program.  These
dependences are very frequent and give an indication of the consequences of
blindly ignoring aliases and heavily optimizing a program.

/Jim

** Copies available from Kathy Schultz (kathy@cs.wisc.edu) or

Technical Reports Librarian
Computer Sciences Department
University of Wisconsin
1210 W. Dayton St.
Madison, WI 53706
-- 
Send compilers articles to compilers@esegue.segue.boston.ma.us
{spdcc | ima | lotus}!esegue.  Meta-mail to compilers-request@esegue.
Please send responses to the author of the message, not the poster.