public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add missing ZLIBINC to CFLAGS-optinfo-emit-json.o
@ 2018-11-13 18:28 David Malcolm
  0 siblings, 0 replies; 4+ messages in thread
From: David Malcolm @ 2018-11-13 18:28 UTC (permalink / raw)
  To: Kyrill Tkachov; +Cc: Jeff Law, gcc-patches, David Malcolm

On Tue, 2018-11-13 at 17:58 +0000, Kyrill Tkachov wrote:
> Hi David,
> 
> On 09/11/18 21:00, Jeff Law wrote:
> > On 11/9/18 10:51 AM, David Malcolm wrote:
> > > One of the concerns noted at Cauldron about -fsave-optimization-
> > > record
> > > was the size of the output files.
> > > 
> > > This file implements compression of the -fsave-optimization-
> > > record
> > > output, using zlib.
> > > 
> > > I did some before/after testing of this patch, using SPEC 2017's
> > > 502.gcc_r with -O3, looking at the sizes of the generated
> > > FILENAME.opt-record.json[.gz] files.
> > > 
> > > The largest file was for insn-attrtab.c:
> > >   before:  171736285 bytes (164M)
> > >   after:     5304015 bytes (5.1M)
> > > 
> > > Smallest file was for vasprintf.c:
> > >   before:      30567 bytes
> > >   after:        4485 bytes
> > > 
> > > Median file by size before was lambda-mat.c:
> > >   before:    2266738 bytes (2.2M)
> > >   after:       75988 bytes (15K)
> > > 
> > > Total of all files in the benchmark:
> > >   before: 2041720713 bytes (1.9G)
> > >   after:    66870770 bytes (63.8M)
> > > 
> > > ...so clearly compression is a big win in terms of file size, at
> > > the
> > > cost of making the files slightly more awkward to work with. [1]
> > > I also wonder if we want to support any pre-filtering of the
> > > output
> > > (FWIW roughly half of the biggest file seems to be "Adding assert
> > > for "
> > > messages from tree-vrp.c).
> > > 
> > > Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
> > > 
> > > OK for trunk?
> > > 
> 
> So does this now add a dependency on zlib?
> I can't build GCC on my aarch64-none-linux machine after this patch
> due to a missing zlib.h.
> I see there's a zlib in the top-level GCC tree. Is that build/used
> during the GCC build itself?
> 
> Thanks,
> Kyrill

Sorry about that.  Does the following patch fix the build for you?

gcc/ChangeLog:
	* Makefile.in (CFLAGS-optinfo-emit-json.o): Add $(ZLIBINC).
---
 gcc/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 16c9ed6..1e8a311 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2233,7 +2233,7 @@ s-bversion: BASE-VER
 	$(STAMP) s-bversion
 
 CFLAGS-toplev.o += -DTARGET_NAME=\"$(target_noncanonical)\"
-CFLAGS-optinfo-emit-json.o += -DTARGET_NAME=\"$(target_noncanonical)\"
+CFLAGS-optinfo-emit-json.o += -DTARGET_NAME=\"$(target_noncanonical)\" $(ZLIBINC)
 
 pass-instances.def: $(srcdir)/passes.def $(PASSES_EXTRA) \
 		    $(srcdir)/gen-pass-instances.awk
-- 
1.8.5.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add missing ZLIBINC to CFLAGS-optinfo-emit-json.o
  2018-11-14  9:49   ` Kyrill Tkachov
@ 2018-11-14 19:02     ` David Malcolm
  0 siblings, 0 replies; 4+ messages in thread
From: David Malcolm @ 2018-11-14 19:02 UTC (permalink / raw)
  To: Kyrill Tkachov; +Cc: Jeff Law, gcc-patches

On Wed, 2018-11-14 at 09:49 +0000, Kyrill Tkachov wrote:
> On 13/11/18 18:45, David Malcolm wrote:
> > On Tue, 2018-11-13 at 17:58 +0000, Kyrill Tkachov wrote:
> > > Hi David,
> > > 
> > > On 09/11/18 21:00, Jeff Law wrote:
> > > > On 11/9/18 10:51 AM, David Malcolm wrote:
> > > > > One of the concerns noted at Cauldron about -fsave-
> > > > > optimization-
> > > > > record
> > > > > was the size of the output files.
> > > > > 
> > > > > This file implements compression of the -fsave-optimization-
> > > > > record
> > > > > output, using zlib.
> > > > > 
> > > > > I did some before/after testing of this patch, using SPEC
> > > > > 2017's
> > > > > 502.gcc_r with -O3, looking at the sizes of the generated
> > > > > FILENAME.opt-record.json[.gz] files.
> > > > > 
> > > > > The largest file was for insn-attrtab.c:
> > > > >    before:  171736285 bytes (164M)
> > > > >    after:     5304015 bytes (5.1M)
> > > > > 
> > > > > Smallest file was for vasprintf.c:
> > > > >    before:      30567 bytes
> > > > >    after:        4485 bytes
> > > > > 
> > > > > Median file by size before was lambda-mat.c:
> > > > >    before:    2266738 bytes (2.2M)
> > > > >    after:       75988 bytes (15K)
> > > > > 
> > > > > Total of all files in the benchmark:
> > > > >    before: 2041720713 bytes (1.9G)
> > > > >    after:    66870770 bytes (63.8M)
> > > > > 
> > > > > ...so clearly compression is a big win in terms of file size,
> > > > > at
> > > > > the
> > > > > cost of making the files slightly more awkward to work with.
> > > > > [1]
> > > > > I also wonder if we want to support any pre-filtering of the
> > > > > output
> > > > > (FWIW roughly half of the biggest file seems to be "Adding
> > > > > assert
> > > > > for "
> > > > > messages from tree-vrp.c).
> > > > > 
> > > > > Successfully bootstrapped & regrtested on x86_64-pc-linux-
> > > > > gnu.
> > > > > 
> > > > > OK for trunk?
> > > > > 
> > > 
> > > So does this now add a dependency on zlib?
> > > I can't build GCC on my aarch64-none-linux machine after this
> > > patch
> > > due to a missing zlib.h.
> > > I see there's a zlib in the top-level GCC tree. Is that
> > > build/used
> > > during the GCC build itself?
> > > 
> > > Thanks,
> > > Kyrill
> > 
> > Sorry about that.  Does the following patch fix the build for you?
> 
> Yes, that fixes it.
> Thanks David!
> 
> Kyrill

Thanks; I've committed it to trunk as r266156.

Dave

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add missing ZLIBINC to CFLAGS-optinfo-emit-json.o
  2018-11-13 18:45 ` [PATCH] Add missing ZLIBINC to CFLAGS-optinfo-emit-json.o David Malcolm
@ 2018-11-14  9:49   ` Kyrill Tkachov
  2018-11-14 19:02     ` David Malcolm
  0 siblings, 1 reply; 4+ messages in thread
From: Kyrill Tkachov @ 2018-11-14  9:49 UTC (permalink / raw)
  To: David Malcolm; +Cc: Jeff Law, gcc-patches


On 13/11/18 18:45, David Malcolm wrote:
> On Tue, 2018-11-13 at 17:58 +0000, Kyrill Tkachov wrote:
>> Hi David,
>>
>> On 09/11/18 21:00, Jeff Law wrote:
>>> On 11/9/18 10:51 AM, David Malcolm wrote:
>>>> One of the concerns noted at Cauldron about -fsave-optimization-
>>>> record
>>>> was the size of the output files.
>>>>
>>>> This file implements compression of the -fsave-optimization-
>>>> record
>>>> output, using zlib.
>>>>
>>>> I did some before/after testing of this patch, using SPEC 2017's
>>>> 502.gcc_r with -O3, looking at the sizes of the generated
>>>> FILENAME.opt-record.json[.gz] files.
>>>>
>>>> The largest file was for insn-attrtab.c:
>>>>    before:  171736285 bytes (164M)
>>>>    after:     5304015 bytes (5.1M)
>>>>
>>>> Smallest file was for vasprintf.c:
>>>>    before:      30567 bytes
>>>>    after:        4485 bytes
>>>>
>>>> Median file by size before was lambda-mat.c:
>>>>    before:    2266738 bytes (2.2M)
>>>>    after:       75988 bytes (15K)
>>>>
>>>> Total of all files in the benchmark:
>>>>    before: 2041720713 bytes (1.9G)
>>>>    after:    66870770 bytes (63.8M)
>>>>
>>>> ...so clearly compression is a big win in terms of file size, at
>>>> the
>>>> cost of making the files slightly more awkward to work with. [1]
>>>> I also wonder if we want to support any pre-filtering of the
>>>> output
>>>> (FWIW roughly half of the biggest file seems to be "Adding assert
>>>> for "
>>>> messages from tree-vrp.c).
>>>>
>>>> Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
>>>>
>>>> OK for trunk?
>>>>
>> So does this now add a dependency on zlib?
>> I can't build GCC on my aarch64-none-linux machine after this patch
>> due to a missing zlib.h.
>> I see there's a zlib in the top-level GCC tree. Is that build/used
>> during the GCC build itself?
>>
>> Thanks,
>> Kyrill
> Sorry about that.  Does the following patch fix the build for you?

Yes, that fixes it.
Thanks David!

Kyrill

> gcc/ChangeLog:
> 	* Makefile.in (CFLAGS-optinfo-emit-json.o): Add $(ZLIBINC).
> ---
>   gcc/Makefile.in | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/Makefile.in b/gcc/Makefile.in
> index 16c9ed6..1e8a311 100644
> --- a/gcc/Makefile.in
> +++ b/gcc/Makefile.in
> @@ -2233,7 +2233,7 @@ s-bversion: BASE-VER
>   	$(STAMP) s-bversion
>   
>   CFLAGS-toplev.o += -DTARGET_NAME=\"$(target_noncanonical)\"
> -CFLAGS-optinfo-emit-json.o += -DTARGET_NAME=\"$(target_noncanonical)\"
> +CFLAGS-optinfo-emit-json.o += -DTARGET_NAME=\"$(target_noncanonical)\" $(ZLIBINC)
>   
>   pass-instances.def: $(srcdir)/passes.def $(PASSES_EXTRA) \
>   		    $(srcdir)/gen-pass-instances.awk

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Add missing ZLIBINC to CFLAGS-optinfo-emit-json.o
  2018-11-13 17:58 [PATCH] -fsave-optimization-record: compress the output using zlib Kyrill Tkachov
@ 2018-11-13 18:45 ` David Malcolm
  2018-11-14  9:49   ` Kyrill Tkachov
  0 siblings, 1 reply; 4+ messages in thread
From: David Malcolm @ 2018-11-13 18:45 UTC (permalink / raw)
  To: Kyrill Tkachov; +Cc: Jeff Law, gcc-patches, David Malcolm

On Tue, 2018-11-13 at 17:58 +0000, Kyrill Tkachov wrote:
> Hi David,
> 
> On 09/11/18 21:00, Jeff Law wrote:
> > On 11/9/18 10:51 AM, David Malcolm wrote:
> > > One of the concerns noted at Cauldron about -fsave-optimization-
> > > record
> > > was the size of the output files.
> > > 
> > > This file implements compression of the -fsave-optimization-
> > > record
> > > output, using zlib.
> > > 
> > > I did some before/after testing of this patch, using SPEC 2017's
> > > 502.gcc_r with -O3, looking at the sizes of the generated
> > > FILENAME.opt-record.json[.gz] files.
> > > 
> > > The largest file was for insn-attrtab.c:
> > >   before:  171736285 bytes (164M)
> > >   after:     5304015 bytes (5.1M)
> > > 
> > > Smallest file was for vasprintf.c:
> > >   before:      30567 bytes
> > >   after:        4485 bytes
> > > 
> > > Median file by size before was lambda-mat.c:
> > >   before:    2266738 bytes (2.2M)
> > >   after:       75988 bytes (15K)
> > > 
> > > Total of all files in the benchmark:
> > >   before: 2041720713 bytes (1.9G)
> > >   after:    66870770 bytes (63.8M)
> > > 
> > > ...so clearly compression is a big win in terms of file size, at
> > > the
> > > cost of making the files slightly more awkward to work with. [1]
> > > I also wonder if we want to support any pre-filtering of the
> > > output
> > > (FWIW roughly half of the biggest file seems to be "Adding assert
> > > for "
> > > messages from tree-vrp.c).
> > > 
> > > Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
> > > 
> > > OK for trunk?
> > > 
> 
> So does this now add a dependency on zlib?
> I can't build GCC on my aarch64-none-linux machine after this patch
> due to a missing zlib.h.
> I see there's a zlib in the top-level GCC tree. Is that build/used
> during the GCC build itself?
> 
> Thanks,
> Kyrill

Sorry about that.  Does the following patch fix the build for you?

gcc/ChangeLog:
	* Makefile.in (CFLAGS-optinfo-emit-json.o): Add $(ZLIBINC).
---
 gcc/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 16c9ed6..1e8a311 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2233,7 +2233,7 @@ s-bversion: BASE-VER
 	$(STAMP) s-bversion
 
 CFLAGS-toplev.o += -DTARGET_NAME=\"$(target_noncanonical)\"
-CFLAGS-optinfo-emit-json.o += -DTARGET_NAME=\"$(target_noncanonical)\"
+CFLAGS-optinfo-emit-json.o += -DTARGET_NAME=\"$(target_noncanonical)\" $(ZLIBINC)
 
 pass-instances.def: $(srcdir)/passes.def $(PASSES_EXTRA) \
 		    $(srcdir)/gen-pass-instances.awk
-- 
1.8.5.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-14 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13 18:28 [PATCH] Add missing ZLIBINC to CFLAGS-optinfo-emit-json.o David Malcolm
  -- strict thread matches above, loose matches on Subject: below --
2018-11-13 17:58 [PATCH] -fsave-optimization-record: compress the output using zlib Kyrill Tkachov
2018-11-13 18:45 ` [PATCH] Add missing ZLIBINC to CFLAGS-optinfo-emit-json.o David Malcolm
2018-11-14  9:49   ` Kyrill Tkachov
2018-11-14 19:02     ` David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).