Message ID | 20110613125412.GC11211@kam.mff.cuni.cz |
---|---|
State | New |
Headers | show |
On Mon, Jun 13, 2011 at 2:54 PM, Jan Hubicka <hubicka@ucw.cz> wrote: > Hi, > by accident I noticed that BINFO_VIRTUALs streaming is really expensive. It > about doubles amount of IL and types streamed by Mozilla. > > One obvious optimization is to not stream into ltrans unit where it is > too late to do any useful devirtualization anyway. > Doing so reduces /tmp usage from 1.7GB to 1.1GB and proportionaly reduces > streaming out time. > > Bootstrapped/regtested x86_64-linux. > OK? Ok. Thanks, Richard. > Honza > * lto-streamer-out.c (lto_output_ts_binfo_tree_pointers): Do not > stream BINFO_VIRTUALS to ltrans units. > Index: lto-streamer-out.c > =================================================================== > --- lto-streamer-out.c (revision 174985) > +++ lto-streamer-out.c (working copy) > @@ -1117,7 +1117,11 @@ > > lto_output_tree_or_ref (ob, BINFO_OFFSET (expr), ref_p); > lto_output_tree_or_ref (ob, BINFO_VTABLE (expr), ref_p); > - lto_output_tree_or_ref (ob, BINFO_VIRTUALS (expr), ref_p); > + /* BINFO_VIRTUALS is used to drive type based devirtualizatoin. It often links > + together large portions of programs making it harder to partition. Becuase > + devirtualization is interesting before inlining, only, there is no real > + need to ship it into ltrans partition. */ > + lto_output_tree_or_ref (ob, flag_wpa ? NULL : BINFO_VIRTUALS (expr), ref_p); > lto_output_tree_or_ref (ob, BINFO_VPTR_FIELD (expr), ref_p); > > output_uleb128 (ob, VEC_length (tree, BINFO_BASE_ACCESSES (expr))); >
Index: lto-streamer-out.c =================================================================== --- lto-streamer-out.c (revision 174985) +++ lto-streamer-out.c (working copy) @@ -1117,7 +1117,11 @@ lto_output_tree_or_ref (ob, BINFO_OFFSET (expr), ref_p); lto_output_tree_or_ref (ob, BINFO_VTABLE (expr), ref_p); - lto_output_tree_or_ref (ob, BINFO_VIRTUALS (expr), ref_p); + /* BINFO_VIRTUALS is used to drive type based devirtualizatoin. It often links + together large portions of programs making it harder to partition. Becuase + devirtualization is interesting before inlining, only, there is no real + need to ship it into ltrans partition. */ + lto_output_tree_or_ref (ob, flag_wpa ? NULL : BINFO_VIRTUALS (expr), ref_p); lto_output_tree_or_ref (ob, BINFO_VPTR_FIELD (expr), ref_p); output_uleb128 (ob, VEC_length (tree, BINFO_BASE_ACCESSES (expr)));