[llvm-commits] Function aliases

Reid Spencer rspencer at reidspencer.com
Fri Apr 20 13:07:44 PDT 2007


On Fri, 2007-04-20 at 22:12 +0400, Anton Korobeynikov wrote:
> Gordon,
> 
> > Why not simply reinsert the aliased GV into the symbol table under the
> > alias name? In this manner, alias objects would not need to derive
> > from GlobalValue at all. Aliases could be stored in a list on the side
> > as you describe, solving the memory usage problem. The majority of
> > code could remain ignorant of them,
> The main problem is that code should not ignore them :( 

90% of LLVM *should* ignore them. The only time that they are needed is
at codegen time.

> Also, they
> should be codegen'ed in some funky way, when we're needed both names:
> alias and it's target at one place. 

Right. But, why impose a new concept on all of LLVM just for this very
limited code gen situation. I would rather have the CodeGen library
simply look for GVars or Functions that have two names. 

> Such information can be unavailable
> if we'll put aliases in the separate table. 

Certainly the codegen can be augmented to query a separate table.

> I don't think, there is some
> "direct" way to query symbol table at codegen-level.

It could be arrange in SelectionDAGISel.cpp during the lowering.


>  However, this can
> be good idea: to have some module-level map, which stores alias targets.

The "module-level map" is just the symtab. When SelectionDAGISel lowers
the IR to machine level it just needs to have a way to associate
multiple names with a given Function or GVar node.

Reid.

> 




More information about the llvm-commits mailing list