Message ID | 20151125091227.GA70325@kam.mff.cuni.cz |
---|---|
State | New |
Headers | show |
On Wed, 25 Nov 2015, Jan Hubicka wrote: > Hi, > this patch adds timevar for loweleve LTO streaming stuff. > Bootstrapped/regtested x86_64-linux, OK? Ok. Richard. > * timevar.def (TV_IPA_LTO_DECOMPRESS, TV_IPA_LTO_COMPRESS, > TV_IPA_LTO_OUTPUT): New. > * lto-comporess.c: Include timevar.h > (lto_end_compression, lto_end_uncompression): Add timers. > * langhooks.c: Include timevar.h > (lhd_append_data): Add timer. > Index: timevar.def > =================================================================== > --- timevar.def (revision 230847) > +++ timevar.def (working copy) > @@ -79,6 +79,9 @@ DEFTIMEVAR (TV_IPA_INLINING , " > DEFTIMEVAR (TV_IPA_FNSPLIT , "ipa function splitting") > DEFTIMEVAR (TV_IPA_COMDATS , "ipa comdats") > DEFTIMEVAR (TV_IPA_OPT , "ipa various optimizations") > +DEFTIMEVAR (TV_IPA_LTO_DECOMPRESS , "lto stream inflate") > +DEFTIMEVAR (TV_IPA_LTO_COMPRESS , "lto stream deflate") > +DEFTIMEVAR (TV_IPA_LTO_OUTPUT , "lto stream output") > DEFTIMEVAR (TV_IPA_LTO_GIMPLE_IN , "ipa lto gimple in") > DEFTIMEVAR (TV_IPA_LTO_GIMPLE_OUT , "ipa lto gimple out") > DEFTIMEVAR (TV_IPA_LTO_DECL_IN , "ipa lto decl in") > Index: lto-compress.c > =================================================================== > --- lto-compress.c (revision 230847) > +++ lto-compress.c (working copy) > @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. > system.h. */ > #include <zlib.h> > #include "lto-compress.h" > +#include "timevar.h" > > /* Compression stream structure, holds the flush callback and opaque token, > the buffered data, and a note of whether compressing or uncompressing. */ > @@ -177,6 +178,8 @@ lto_end_compression (struct lto_compress > > gcc_assert (stream->is_compression); > > + timevar_push (TV_IPA_LTO_COMPRESS); > + > out_stream.next_out = outbuf; > out_stream.avail_out = outbuf_length; > out_stream.next_in = cursor; > @@ -220,6 +223,7 @@ lto_end_compression (struct lto_compress > > lto_destroy_compression_stream (stream); > free (outbuf); > + timevar_pop (TV_IPA_LTO_COMPRESS); > } > > /* Return a new uncompression stream, with CALLBACK flush function passed > @@ -260,6 +264,7 @@ lto_end_uncompression (struct lto_compre > size_t uncompressed_bytes = 0; > > gcc_assert (!stream->is_compression); > + timevar_push (TV_IPA_LTO_DECOMPRESS); > > while (remaining > 0) > { > @@ -311,4 +316,5 @@ lto_end_uncompression (struct lto_compre > > lto_destroy_compression_stream (stream); > free (outbuf); > + timevar_pop (TV_IPA_LTO_DECOMPRESS); > } > Index: langhooks.c > =================================================================== > --- langhooks.c (revision 230847) > +++ langhooks.c (working copy) > @@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. > #include "langhooks.h" > #include "tree-diagnostic.h" > #include "output.h" > +#include "timevar.h" > > /* Do nothing; in many cases the default hook. */ > > @@ -658,7 +659,11 @@ void > lhd_append_data (const void *data, size_t len, void *) > { > if (data) > - assemble_string ((const char *)data, len); > + { > + timevar_push (TV_IPA_LTO_OUTPUT); > + assemble_string ((const char *)data, len); > + timevar_pop (TV_IPA_LTO_OUTPUT); > + } > } > > > >
Index: timevar.def =================================================================== --- timevar.def (revision 230847) +++ timevar.def (working copy) @@ -79,6 +79,9 @@ DEFTIMEVAR (TV_IPA_INLINING , " DEFTIMEVAR (TV_IPA_FNSPLIT , "ipa function splitting") DEFTIMEVAR (TV_IPA_COMDATS , "ipa comdats") DEFTIMEVAR (TV_IPA_OPT , "ipa various optimizations") +DEFTIMEVAR (TV_IPA_LTO_DECOMPRESS , "lto stream inflate") +DEFTIMEVAR (TV_IPA_LTO_COMPRESS , "lto stream deflate") +DEFTIMEVAR (TV_IPA_LTO_OUTPUT , "lto stream output") DEFTIMEVAR (TV_IPA_LTO_GIMPLE_IN , "ipa lto gimple in") DEFTIMEVAR (TV_IPA_LTO_GIMPLE_OUT , "ipa lto gimple out") DEFTIMEVAR (TV_IPA_LTO_DECL_IN , "ipa lto decl in") Index: lto-compress.c =================================================================== --- lto-compress.c (revision 230847) +++ lto-compress.c (working copy) @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. system.h. */ #include <zlib.h> #include "lto-compress.h" +#include "timevar.h" /* Compression stream structure, holds the flush callback and opaque token, the buffered data, and a note of whether compressing or uncompressing. */ @@ -177,6 +178,8 @@ lto_end_compression (struct lto_compress gcc_assert (stream->is_compression); + timevar_push (TV_IPA_LTO_COMPRESS); + out_stream.next_out = outbuf; out_stream.avail_out = outbuf_length; out_stream.next_in = cursor; @@ -220,6 +223,7 @@ lto_end_compression (struct lto_compress lto_destroy_compression_stream (stream); free (outbuf); + timevar_pop (TV_IPA_LTO_COMPRESS); } /* Return a new uncompression stream, with CALLBACK flush function passed @@ -260,6 +264,7 @@ lto_end_uncompression (struct lto_compre size_t uncompressed_bytes = 0; gcc_assert (!stream->is_compression); + timevar_push (TV_IPA_LTO_DECOMPRESS); while (remaining > 0) { @@ -311,4 +316,5 @@ lto_end_uncompression (struct lto_compre lto_destroy_compression_stream (stream); free (outbuf); + timevar_pop (TV_IPA_LTO_DECOMPRESS); } Index: langhooks.c =================================================================== --- langhooks.c (revision 230847) +++ langhooks.c (working copy) @@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. #include "langhooks.h" #include "tree-diagnostic.h" #include "output.h" +#include "timevar.h" /* Do nothing; in many cases the default hook. */ @@ -658,7 +659,11 @@ void lhd_append_data (const void *data, size_t len, void *) { if (data) - assemble_string ((const char *)data, len); + { + timevar_push (TV_IPA_LTO_OUTPUT); + assemble_string ((const char *)data, len); + timevar_pop (TV_IPA_LTO_OUTPUT); + } }