This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can we speed up the gcc_target structure?


> On Sun, 18 Jan 2004, Jan Hubicka wrote:
> > > as having internal linkage.  In LLVM, this is accomplished with the
> > > "internalize" pass, which by default marks all symbols internal if the
> > > linked program contains a main (ie, this does not happen for libraries).
> > > This change enables a _lot_ of interprocedural optimizations that would
> > > not be safe to perform otherwise.  Of course the internalize pass can be
> > > completely disabled, or enabled for a list of symbols as needed.
> >
> > In my prototype unit-at-a-time code I have either the default mode,
> > where all external symbols are just external and -fwhole-program mode
> > where all symbols that do have deifnitions are considered internal
> > except for main and symbols marked by "used" attribute.
> 
> But they get emitted to the executable as external?

If you mark no symbols via special attribute, only main should be
external.  If you mark more, you get more.
> 
> > I suppose this is mostly equivalent to what LLVM have except for the
> > fact that list of symbols with external linkage is boundled in the
> > source itself, instead of being in separate file. Do you have any
> > experience with the separate file having considerable benefits?
> 
> I'm not sure if I understand what you mean here, can you please clarify?

You mentioned that instead of using attribute in the source file, you
get list of functions.  From here the lists are comming?
> 
> > > The nice thing about LLVM using the internalize pass is that if it is used
> > > incorrectly, a program will not link.  If you use a "whole program"
> > > compiler incorrectly, it will be silently misoptimized, which IMHO is
> > > _much_ worse.
> >
> > My plan is to make all symbols that are considered local static so it
> > will elliminate this problem.
> 
> Ok, but you should at least think about adding support for programs that
> (for example) dynamically load shared objects that call back into the main
> program.  People will get unhappy if 'gimp' doesn't work in this mode, for
> example.

I expect people to just mark the interface functions via the attribute.

Honza
> 
> -Chris
> 
> -- 
> http://llvm.cs.uiuc.edu/
> http://www.nondot.org/~sabre/Projects/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]