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: RFC: IPO optimization framework for GCC


Thanks to everyone who replied to my mail, I am currently waiting for
some follow-ups to replies I got off-list.  In the mean time I wonder if
we could talk about Devang's questions on what this might look like to
a user.

> From: Devang Patel <devang.patel@gmail.com>
>
> It is useful to get clear understanding of few simpler things before
> tackling IL issue.
> 
> First question is - What is the user interface ? Few alternatives :
> 
> 1)  gcc <blah> -fenable-ipo input1.c input2.c input3.c -o output
> 
>      Here, writing IL on the disk, and reading it back, and optimizing it,
> etc.. are all hidden from users.

But at the cost of having to put all the source compiles on one GCC
command line.  We could probably do this today without reading or
writing anything to disk (as long as we didn't run out of memory).

> 2)  gcc <blah> -fwrite-ipo input1.c -o input1.data
>      gcc <blah> -fwrite-ipo input2.c -o input2.data
>      gcc <blah> -fwrite-ipo input3.c -o input3.data
> 
>      gcc <blah> -fread-ipo input1.data input2.data input3.data -o output
> 
> 3)  gcc <blah> -fwrite-ipo input1.c -o input1.data
>      gcc <blah> -fuse-ipo input1.data input2.c -o input2.data
>      gcc <blah> -fuse-ipo input2.data input3.c -o output
> 
> 4)  gcc <blah> -fwrite-ipo input1.c -o input1.data
>      gcc <blah> -fwrite-ipo input2.c -o input2.data
>      gcc <blah> -fwrite-ipo input3.c -o input3.data
> 
>      glo <blah> -fread-ipo input1.data input2.data input3.data -o output

Could we just have -fwrite-ipo create a '.o' file that contains the
intermediate representation (instead of being a real object file).

Then when the linker is called it would call the compiler with all the
files that have intermediate code instead of object code and finish up
the compilation.  Actually, maybe we could add the restriction that
you have to use GCC to call the linker when doing IPO and that way 
GCC could finish up the compilations before it calls the linker.

> Second question is - When to put info on the disk? Few alternatives,
> 1) Before gimplfication
> 2) Before optimizing tree-ssa
> 3) After tree-ssa optimization is complete
> 4) Immediately after generating RTL
> 5) Halfway throuh RTL passes
> etc.. And answer to this question largely depend on the optimization
> passes that work on whole program info.

I would think one would want to put the info out before optimizing
tree-ssa since you would hope that the IPO data from other modules would
let you do better tree-ssa optimizations.

> I do not know whether these two questions are already answered or not.

I don't think anything has been answered yet.

Steve Ellcey
sje@cup.hp.com


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