From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 6EEEF385481F; Thu, 20 May 2021 12:44:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EEEF385481F 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)] Try LTO partial linking. X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/users/marxin/heads/partial-linking X-Git-Oldrev: 9e0a5e3ea37f9d7d2b6f2dab7c0bfbeaf08466a3 X-Git-Newrev: 7b27ae3ba562e447a8a12b8851ce8e4a769033a7 Message-Id: <20210520124436.6EEEF385481F@sourceware.org> Date: Thu, 20 May 2021 12:44:36 +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, 20 May 2021 12:44:36 -0000 https://gcc.gnu.org/g:7b27ae3ba562e447a8a12b8851ce8e4a769033a7 commit 7b27ae3ba562e447a8a12b8851ce8e4a769033a7 Author: Martin Liska Date: Thu May 20 14:29:35 2021 +0200 Try LTO partial linking. Diff: --- gcc/Makefile.in | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 1164554e6d6..decfea7412b 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 @@ -1282,12 +1284,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 \ @@ -1295,7 +1295,6 @@ OBJS = \ insn-output.o \ insn-peep.o \ insn-preds.o \ - insn-recog.o \ insn-enums.o \ ggc-page.o \ adjust-alignment.o \ @@ -2627,6 +2626,32 @@ s-match: build/genmatch$(build_exeext) $(srcdir)/match.pd cfn-operators.pd generic-match.c $(STAMP) s-match +gimple-match.o: gimple-match.c $(generated_files) +generic-match.o: generic-match.c $(generated_files) + +ifdef PARTIAL_LTO +LTO_LINKER_FLAGS = -flto=auto --param=lto-partitions=16 -flinker-output=nolto-rel -r +LTO_FLAGS = -flto + +gimple-match-lto.o: gimple-match.c + $(COMPILE) $< $(LTO_FLAGS) +generic-match-lto.o: generic-match.c + $(COMPILE) $< $(LTO_FLAGS) +insn-recog-lto.o: insn-recog.c + $(COMPILE) $< $(LTO_FLAGS) +insn-emit-lto.o: insn-emit.c + $(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 +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 \