This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[lto] Pass ordering and the different lto1 personalities
- From: Diego Novillo <dnovillo at google dot com>
- To: Jan Hubicka <jh at suse dot cz>, Rafael Espindola <espindola at google dot com>, Simon Baldwin <simonb at google dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 19 Feb 2009 10:58:40 -0500
- Subject: [lto] Pass ordering and the different lto1 personalities
We were chatting on IRC about the problem Simon found with IPCP
getting confused because during -fwhopr builds, the inliner
always runs first, so when LTRANS starts up, we run all the IPA
passes before applying inlining decisions. This confuses IPCP.
For lto1 we have 3 different modes of operation:
LTO (-flto)
This does the usual link-time operations. All the IL files are
loaded in memory (callgraph and bodies) and then
cgraph_optimize() is invoked to do IPA, GIMPLE, RTL
optimizations and generate final code.
WPA (-fwpa)
This is stage 2 of WHOPR. We load the whole callgraph sans
the function bodies and run all the IPA passes capable of
operating with summaries only (currently, the inliner). We then
partition the callgraph into separate sub-graphs which are
written out to new IL files.
LTRANS (-fltran)
This is stage 3 of WHOPR. We execute as many LTRANS processes
as IL files we wrote out during WPA. Each of these will read
a single IL file and compile it exactly as LTO. After this
stage, all the output files are ready for final linking.
The problem here is that LTRANS will run the standard pipeline
over a callgraph that hasn't been "settled" (i.e., no inlining
decisions have been applied yet). Perhaps the first thing LTRANS
should do is just call execute_all_ipa_transforms() and then
proceed with the regular pipeline.
Honza, these three stages are all controlled by lto.c:lto_main.
Diego.