From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 7A26C385800E; Thu, 3 Feb 2022 11:14:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A26C385800E 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-v3)] 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-v3 X-Git-Oldrev: 9db03cd0caf6bbde1de302bf3509dc26ca8bff2b X-Git-Newrev: 81a33b52633c5451272f7fd4ff81d315b90d7760 Message-Id: <20220203111409.7A26C385800E@sourceware.org> Date: Thu, 3 Feb 2022 11:14:09 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2022 11:14:09 -0000 https://gcc.gnu.org/g:81a33b52633c5451272f7fd4ff81d315b90d7760 commit 81a33b52633c5451272f7fd4ff81d315b90d7760 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 31ff95500c9..ef97be76d98 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -220,7 +220,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 @@ -1285,12 +1287,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 \ @@ -1298,7 +1298,6 @@ OBJS = \ insn-output.o \ insn-peep.o \ insn-preds.o \ - insn-recog.o \ insn-enums.o \ ggc-page.o \ adjust-alignment.o \ @@ -2631,8 +2630,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 \ @@ -2645,6 +2644,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) \ $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \