aliased/non aliased parameters

Nathan Sidwell <nathan@pact.srf.ac.uk>
4 May 1997 22:11:29 -0400

          From comp.compilers

Related articles
aliased/non aliased parameters nathan@pact.srf.ac.uk (Nathan Sidwell) (1997-05-04)
Re: aliased/non aliased parameters hbaker@netcom.com (1997-05-08)
| List of all articles for this month |
From: Nathan Sidwell <nathan@pact.srf.ac.uk>
Newsgroups: comp.compilers
Date: 4 May 1997 22:11:29 -0400
Organization: Partnership In Advanced Computing Technologies
Keywords: optimize, question

Hi,


I'm trying to locate information about compiling two versions of
functions where parameters can be passed by possibly aliased
references (like in C++). The technique is where the compiler
generates two function bodies, one assuming no aliased and the other
not assuming aliases. Then at the point of the call the unaliased
version is called if the compiler can prove the objects are unaliased.
In C++ you'd have somthing like


void func(int &, int &);
int someGlobal;
void myfunc(int &param)
{
int local1, local2;


func(local1, local2); // calls unaliased version
func(local1, param); // calls unaliased version
func(param, someGlobal); // calls aliased version
}


Searching the archives hasn't shown up anything (though maybe I'm using
the wrong keywords).


Has anyone information on the cost/benefits of this technique?


nathan
--
Nathan Sidwell The windy road is more interesting
Chameleon Architecture Group at SGS-Thomson, formerly Inmos
http://www.pact.srf.ac.uk/~nathan/ Tel 0117 9707182
nathan@pact.srf.ac.uk or nathan@bristol.st.com
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.