From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id A69FA3858C1F; Tue, 29 Nov 2022 21:10:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A69FA3858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669756215; bh=Vi9xwz7RW1aQjX6lS1bdB/a1sHbuoKIvMwV1M3DNUss=; h=From:To:Subject:Date:From; b=sHBpJO/BPwPjWhw85r3wwdhIY0exJ5tWSS0XZQ4eswUSKJyuAjcVv8euX2zYgwQGs 4xQ18rF2VH46W4YjHb2CJQOhsid3I5GpfbmYhn2doigWiNxSADECJtBQYloeSs03/H IsEAkUJrR33d+aZ68QWrHbOO8XiU4UWt7tKALKOM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/marxin/heads/partial-linking-v4)] Come up with faster build (PARTIAL_LTO=1). X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/partial-linking-v4 X-Git-Oldrev: 063ba138eaa15ceecf23a24906e0e19be98d509d X-Git-Newrev: fcd652e18e0aa82e1995c8a5426df2eedd5c6501 Message-Id: <20221129211015.A69FA3858C1F@sourceware.org> Date: Tue, 29 Nov 2022 21:10:15 +0000 (GMT) List-Id: https://gcc.gnu.org/g:fcd652e18e0aa82e1995c8a5426df2eedd5c6501 commit fcd652e18e0aa82e1995c8a5426df2eedd5c6501 Author: Martin Liska Date: Thu Feb 3 12:13:42 2022 +0100 Come up with faster build (PARTIAL_LTO=1). Diff: --- gcc/Makefile.in | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index fa5e5b444bb..8b9042757f4 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -223,7 +223,9 @@ libgcov-util.o-warn = -Wno-error libgcov-driver-tool.o-warn = -Wno-error libgcov-merge-tool.o-warn = -Wno-error gimple-match.o-warn = -Wno-unused +gimple-match-lto.o-warn = -Wno-unused generic-match.o-warn = -Wno-unused +generic-match-lto.o-warn = -Wno-unused dfp.o-warn = -Wno-strict-aliasing # All warnings have to be shut off in stage1 if the compiler used then @@ -1297,12 +1299,10 @@ ANALYZER_OBJS = \ # will build them sooner, because they are large and otherwise tend to be # the last objects to finish building. OBJS = \ - gimple-match.o \ - generic-match.o \ + common-base.a \ insn-attrtab.o \ insn-automata.o \ insn-dfatab.o \ - insn-emit.o \ insn-extract.o \ insn-latencytab.o \ insn-modes.o \ @@ -1310,7 +1310,6 @@ OBJS = \ insn-output.o \ insn-peep.o \ insn-preds.o \ - insn-recog.o \ insn-enums.o \ ggc-page.o \ adjust-alignment.o \ @@ -2649,8 +2648,8 @@ s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in false; \ fi -gimple-match.cc: s-match gimple-match-head.cc ; @true -generic-match.cc: s-match generic-match-head.cc ; @true +gimple-match.cc: s-match gimple-match-head.cc insn-attr-common.h ; @true +generic-match.cc: s-match generic-match-head.cc insn-attr-common.h ; @true s-match: build/genmatch$(build_exeext) $(srcdir)/match.pd cfn-operators.pd $(RUN_GEN) build/genmatch$(build_exeext) --gimple $(srcdir)/match.pd \ @@ -2663,6 +2662,32 @@ s-match: build/genmatch$(build_exeext) $(srcdir)/match.pd cfn-operators.pd generic-match.cc $(STAMP) s-match +ifdef PARTIAL_LTO +LTO_LINKER_FLAGS = -flto=auto --param=lto-partitions=`nproc` -flinker-output=nolto-rel -r +LTO_FLAGS = -flto + +gimple-match-lto.o: gimple-match.cc $(TARGET_H) $(generated_files) + $(COMPILE) $< $(LTO_FLAGS) +generic-match-lto.o: generic-match.cc $(TARGET_H) $(generated_files) + $(COMPILE) $< $(LTO_FLAGS) +insn-recog-lto.o: insn-recog.cc + $(COMPILE) $< $(LTO_FLAGS) +insn-emit-lto.o: insn-emit.cc + $(COMPILE) $< $(LTO_FLAGS) + +common-base.a: gimple-match-lto.o generic-match-lto.o insn-recog-lto.o insn-emit-lto.o + -rm -rf $@ + $(LINKER) $^ $(LTO_LINKER_FLAGS) -o common-base.o + $(AR) $(AR_FLAGS)T $@ common-base.o +else +insn-recog.o: insn-recog.cc insn-attr-common.h +insn-emit.o: insn-emit.cc insn-attr-common.h + +common-base.a: gimple-match.o generic-match.o insn-recog.o insn-emit.o + -rm -rf $@ + $(AR) $(AR_FLAGS)T $@ $^ +endif + GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \ $(host_xm_file_list) \ $(OPTIONS_H_EXTRA) \