From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp2200-217.mail.aliyun.com (smtp2200-217.mail.aliyun.com [121.197.200.217]) by sourceware.org (Postfix) with ESMTPS id 11A653857C72 for ; Sun, 27 Sep 2020 02:34:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 11A653857C72 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=c-sky.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=jiejie_rong@c-sky.com X-Alimail-AntiSpam: AC=CONTINUE; BC=0.04436285|-1; CH=green; DM=|CONTINUE|false|; DS=CONTINUE|ham_regular_dialog|0.0016908-0.000139367-0.99817; FP=0|0|0|0|0|-1|-1|-1; HT=e02c03306; MF=jiejie_rong@c-sky.com; NM=1; PH=DS; RN=7; RT=7; SR=0; TI=SMTPD_---.IcfRe9c_1601174046; Received: from 30.225.212.19(mailfrom:jiejie_rong@c-sky.com fp:SMTPD_---.IcfRe9c_1601174046) by smtp.aliyun-inc.com(10.194.99.38); Sun, 27 Sep 2020 10:34:07 +0800 Date: Sun, 27 Sep 2020 10:34:00 +0800 From: Jojo R To: segher@kernel.crashing.org, richard.sandiford@arm.com, ro@CeBiTec.Uni-Bielefeld.DE, richard.guenther@gmail.com, joseph@codesourcery.com, gcc-patches@gcc.gnu.org, yunhai.syh@alibaba-inc.com Message-ID: In-Reply-To: <20200915091550.7424-1-jiejie_rong@c-sky.com> References: <20200915091550.7424-1-jiejie_rong@c-sky.com> Subject: Re: [PATCH v7] genemit.c (main): split insn-emit.c for compiling parallelly X-Readdle-Message-ID: db014ab6-5bd5-48e3-b090-f57bb62b8b9c@Spark MIME-Version: 1.0 X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, HTML_MESSAGE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 02:34:15 -0000 Hi, Has this patch been merged =3F Jojo =E5=9C=A8 2020=E5=B9=B49=E6=9C=8815=E6=97=A5 +0800 PM5:16=EF=BC=8CJojo R = =EF=BC=8C=E5=86=99=E9=81=93=EF=BC=9A > gcc/ChangeLog: > > * genemit.c (main): Print 'split line'. > * Makefile.in (insn-emit.c): Define split count and file > > --- > gcc/Makefile.in =7C 19 +++++++++ > gcc/genemit.c =7C 104 +++++++++++++++++++++++++++++------------------- > 2 files changed, 83 insertions(+), 40 deletions(-) > > diff --git a/gcc/Makefile.in b/gcc/Makefile.in > index 79e854aa938..a7fcc7d5949 100644 > --- a/gcc/Makefile.in > +++ b/gcc/Makefile.in > =40=40 -1258,6 +1258,21 =40=40 ANALYZER=5FOBJS =3D =5C > =23 We put the *-match.o and insn-*.o files first so that a parallel ma= ke > =23 will build them sooner, because they are large and otherwise tend t= o be > =23 the last objects to finish building. > + > +=23 target overrides > +-include =24(tmake=5Ffile) > + > +INSN-GENERATED-SPLIT-NUM =3F=3D 0 > + > +insn-generated-split-num =3D =24(shell i=3D1; j=3D=60expr =24(INSN-GEN= ERATED-SPLIT-NUM) + 1=60; =5C > + while test =24=24i -le =24=24j; do =5C > + echo =24=24i; i=3D=60expr =24=24i + 1=60; =5C > + done) > + > +insn-emit-split-c :=3D =24(foreach o, =24(shell for i in =24(insn-gene= rated-split-num); do echo =24=24i; done), insn-emit=24(o).c) > +insn-emit-split-obj =3D =24(patsubst %.c,%.o, =24(insn-emit-split-c)) > +=24(insn-emit-split-c): insn-emit.c > + > OBJS =3D =5C > gimple-match.o =5C > generic-match.o =5C > =40=40 -1265,6 +1280,7 =40=40 OBJS =3D =5C > insn-automata.o =5C > insn-dfatab.o =5C > insn-emit.o =5C > + =24(insn-emit-split-obj) =5C > insn-extract.o =5C > insn-latencytab.o =5C > insn-modes.o =5C > =40=40 -2365,6 +2381,9 =40=40 =24(simple=5Fgenerated=5Fc:insn-%.c=3Ds-%= ): s-%: build/gen%=24(build=5Fexeext) > =24(RUN=5FGEN) build/gen=24*=24(build=5Fexeext) =24(md=5Ffile) =5C > =24(filter insn-conditions.md,=24=5E) > tmp-=24*.c > =24(SHELL) =24(srcdir)/../move-if-change tmp-=24*.c insn-=24*.c > + =24*v=3D=24=24(echo =24=24(csplit insn-=24*.c /parallel=5C compilatio= n/ -k -s =7B=24(INSN-GENERATED-SPLIT-NUM)=7D -f insn-=24* -b =22%d.c=22 2= >&1));=5C > + =5B =21 =22=24=24=24*v=22 =5D =7C=7C grep =22match not found=22 <<< =24= =24=24*v > + =5B -s insn-=24*0.c =5D =7C=7C (for i in =24(insn-generated-split-num= ); do touch insn-=24*=24=24i.c; done && echo =22=22 > insn-=24*.c) > =24(STAMP) s-=24* > > =23 gencheck doesn't read the machine description, and the file produce= d > diff --git a/gcc/genemit.c b/gcc/genemit.c > index 84d07d388ee..54a0d909d9d 100644 > --- a/gcc/genemit.c > +++ b/gcc/genemit.c > =40=40 -847,24 +847,13 =40=40 handle=5Foverloaded=5Fgen (overloaded=5Fn= ame *oname) > =7D > =7D > > -int > -main (int argc, const char **argv) > -=7B > - progname =3D =22genemit=22; > - > - if (=21init=5Frtx=5Freader=5Fargs (argc, argv)) > - return (=46ATAL=5FEXIT=5FCODE); > - > -=23define DE=46=5FINTERNAL=5FOPTAB=5F=46N(NAME, =46LAGS, OPTAB, TYPE) = =5C > - nofail=5Foptabs=5BOPTAB=23=23=5Foptab=5D =3D true; > -=23include =22internal-fn.def=22 > - > - /* Assign sequential codes to all entries in the machine description > - in parallel with the tables in insn-output.c. */ > - > - printf (=22/* Generated automatically by the program =60genemit'=5Cn=5C= > -from the machine description file =60md'. */=5Cn=5Cn=22); > +/* Print include header. */ > > +static void > +printf=5Finclude (void) > +=7B > + printf (=22/* Generated automatically by the program =60genemit'=5Cn=22= > + =22from the machine description file =60md'. */=5Cn=5Cn=22); > printf (=22=23define IN=5FTARGET=5FCODE 1=5Cn=22); > printf (=22=23include =5C=22config.h=5C=22=5Cn=22); > printf (=22=23include =5C=22system.h=5C=22=5Cn=22); > =40=40 -900,35 +889,70 =40=40 from the machine description file =60md'.= */=5Cn=5Cn=22); > printf (=22=23include =5C=22tm-constrs.h=5C=22=5Cn=22); > printf (=22=23include =5C=22ggc.h=5C=22=5Cn=22); > printf (=22=23include =5C=22target.h=5C=22=5Cn=5Cn=22); > +=7D > > - /* Read the machine description. */ > +/* Generate the =60gen=5F...' function from GET=5FCODE(). */ > > - md=5Frtx=5Finfo info; > - while (read=5Fmd=5Frtx (&info)) > - switch (GET=5FCODE (info.def)) > - =7B > - case DE=46INE=5FINSN: > - gen=5Finsn (&info); > - break; > +static void > +gen=5Fmd=5Frtx (md=5Frtx=5Finfo *info) > +=7B > + switch (GET=5FCODE (info->def)) > + =7B > + case DE=46INE=5FINSN: > + gen=5Finsn (info); > + break; > > - case DE=46INE=5FEXPAND: > - printf (=22/* %s:%d */=5Cn=22, info.loc.filename, info.loc.lineno); > - gen=5Fexpand (&info); > - break; > + case DE=46INE=5FEXPAND: > + printf (=22/* %s:%d */=5Cn=22, info->loc.filename, info->loc.lineno);= > + gen=5Fexpand (info); > + break; > > - case DE=46INE=5FSPLIT: > - printf (=22/* %s:%d */=5Cn=22, info.loc.filename, info.loc.lineno); > - gen=5Fsplit (&info); > - break; > + case DE=46INE=5FSPLIT: > + printf (=22/* %s:%d */=5Cn=22, info->loc.filename, info->loc.lineno);= > + gen=5Fsplit (info); > + break; > > - case DE=46INE=5FPEEPHOLE2: > - printf (=22/* %s:%d */=5Cn=22, info.loc.filename, info.loc.lineno); > - gen=5Fsplit (&info); > - break; > + case DE=46INE=5FPEEPHOLE2: > + printf (=22/* %s:%d */=5Cn=22, info->loc.filename, info->loc.lineno);= > + gen=5Fsplit (info); > + break; > > - default: > - break; > - =7D > + default: > + break; > + =7D > +=7D > + > +int > +main (int argc, const char **argv) > +=7B > + progname =3D =22genemit=22; > + > + if (=21init=5Frtx=5Freader=5Fargs (argc, argv)) > + return (=46ATAL=5FEXIT=5FCODE); > + > +=23define DE=46=5FINTERNAL=5FOPTAB=5F=46N(NAME, =46LAGS, OPTAB, TYPE) = =5C > + nofail=5Foptabs=5BOPTAB=23=23=5Foptab=5D =3D true; > +=23include =22internal-fn.def=22 > + > + /* Assign sequential codes to all entries in the machine description > + in parallel with the tables in insn-output.c. */ > + > + int read=5Fcount =3D 0; > + > + /* Read the machine description. */ > + > + md=5Frtx=5Finfo info; > + while (read=5Fmd=5Frtx (&info)) > + =7B > + if ((read=5Fcount++ % 10000) =3D=3D 0) > + =7B > + printf (=22/* Split file into separate compilation units =22 > + =22for parallel compilation %d */=5Cn=5Cn=22, read=5Fcount); > + printf=5Finclude(); > + =7D > + > + gen=5Fmd=5Frtx (&info); > + =7D > > /* Write out the routines to add CLOBBERs to a pattern and say whether = they > clobber a hard reg. */ > -- > 2.24.3 (Apple Git-128)