public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tamar Christina <Tamar.Christina@arm.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Jeff Law <jeffreyalaw@gmail.com>,
	David Edelsohn <dje.gcc@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: RE: [PATCH 5/5] match.pd: Use splits in makefile and make configurable.
Date: Fri, 5 May 2023 15:37:47 +0000	[thread overview]
Message-ID: <VI1PR08MB53258204EBD6A2E1D5ABECCAFF729@VI1PR08MB5325.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <ZFUhxegm4noMJhKB@tucnak>

> -----Original Message-----
> From: Jakub Jelinek <jakub@redhat.com>
> Sent: Friday, May 5, 2023 4:33 PM
> To: Tamar Christina <Tamar.Christina@arm.com>
> Cc: Jeff Law <jeffreyalaw@gmail.com>; David Edelsohn <dje.gcc@gmail.com>;
> GCC Patches <gcc-patches@gcc.gnu.org>
> Subject: Re: [PATCH 5/5] match.pd: Use splits in makefile and make
> configurable.
> 
> On Fri, May 05, 2023 at 03:22:11PM +0000, Tamar Christina wrote:
> > > We require GNU make, so perhaps we could use something like
> > > $(wordlist
> > > 1,$(NUM_MATCH_SPLITS),$(check_p_numbers))
> > > instead of
> > > $(shell seq 1 $(NUM_MATCH_SPLITS))
> > > provided we move the check_p_numbers definition earlier (or perhaps
> > > bettter rename it to something more generic, so that it is clear
> > > that is a variable holding numbers from 1 to 9999.
> >
> > I'm currently testing
> >
> > NUM_MATCH_SPLITS = @DEFAULT_MATCHPD_PARTITIONS@ -
> MATCH_SPLITS_SEQ =
> > $(shell seq 1 $(NUM_MATCH_SPLITS))
> > +MATCH_SPLITS_SEQ = $(shell echo {1..$(NUM_MATCH_SPLITS)})
> >
> > Which seems to work since it looks like we require an sh compatible shell.
> >
> > Question is this right? From the existing
> 
> AIX /bin/sh certainly doesn't handle that.

Wow, wonder what sh version it has..

> 
> But what do I know about AIX...

Same..

> 
> This seems to work and we use it already in the Makefile.
> If something else works portably, we could change both spots...
> 
> 2023-05-05  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* Makefile.in (check_p_numbers): Rename to one_to_9999, move
> 	earlier with helper variables also renamed.
> 	(MATCH_SPLUT_SEQ): Use $(wordlist
> 1,$(NUM_MATCH_SPLITS),$(one_to_9999))
> 	instead of $(shell seq 1 $(NUM_MATCH_SPLITS)).
> 	(check_p_subdirs): Use $(one_to_9999) instead of
> $(check_p_numbers).
> 
> --- gcc/Makefile.in.jj	2023-05-05 16:02:37.180575333 +0200
> +++ gcc/Makefile.in	2023-05-05 17:20:27.923251821 +0200
> @@ -214,9 +214,19 @@ rtl-ssa-warn = $(STRICT_WARN)
> GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn)
> $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN))
> $(NOCOMMON_FLAG) $($@-warn)  GCC_WARN_CXXFLAGS =
> $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
> 
> +# 1 2 3 ... 9999
> +one_to_9999_0:=1 2 3 4 5 6 7 8 9
> +one_to_9999_1:=0 $(one_to_9999_0)
> +one_to_9999_2:=$(foreach i,$(one_to_9999_0),$(addprefix
> +$(i),$(one_to_9999_1))) one_to_9999_3:=$(addprefix
> 0,$(one_to_9999_1))
> +$(one_to_9999_2) one_to_9999_4:=$(foreach
> +i,$(one_to_9999_0),$(addprefix $(i),$(one_to_9999_3)))
> +one_to_9999_5:=$(addprefix 0,$(one_to_9999_3)) $(one_to_9999_4)
> +one_to_9999_6:=$(foreach i,$(one_to_9999_0),$(addprefix
> +$(i),$(one_to_9999_5)))
> +one_to_9999:=$(one_to_9999_0) $(one_to_9999_2) $(one_to_9999_4)
> +$(one_to_9999_6)
> +
>  # The number of splits to be made for the match.pd files.
>  NUM_MATCH_SPLITS = @DEFAULT_MATCHPD_PARTITIONS@ -
> MATCH_SPLITS_SEQ = $(shell seq 1 $(NUM_MATCH_SPLITS))
> +MATCH_SPLITS_SEQ = $(wordlist
> 1,$(NUM_MATCH_SPLITS),$(one_to_9999))
>  GIMPLE_MATCH_PD_SEQ_SRC = $(patsubst %, gimple-match-%.cc,
> $(MATCH_SPLITS_SEQ))  GIMPLE_MATCH_PD_SEQ_O = $(patsubst %, gimple-
> match-%.o, $(MATCH_SPLITS_SEQ))  GENERIC_MATCH_PD_SEQ_SRC =
> $(patsubst %, generic-match-%.cc, $(MATCH_SPLITS_SEQ)) @@ -4234,18
> +4244,10 @@ $(patsubst %,%-subtargets,$(lang_checks)
> check_p_tool=$(firstword $(subst _, ,$*))
>  check_p_count=$(check_$(check_p_tool)_parallelize)
>  check_p_subno=$(word 2,$(subst _, ,$*))
> -check_p_numbers0:=1 2 3 4 5 6 7 8 9
> -check_p_numbers1:=0 $(check_p_numbers0) -
> check_p_numbers2:=$(foreach i,$(check_p_numbers0),$(addprefix
> $(i),$(check_p_numbers1))) -check_p_numbers3:=$(addprefix
> 0,$(check_p_numbers1)) $(check_p_numbers2) -
> check_p_numbers4:=$(foreach i,$(check_p_numbers0),$(addprefix
> $(i),$(check_p_numbers3))) -check_p_numbers5:=$(addprefix
> 0,$(check_p_numbers3)) $(check_p_numbers4) -
> check_p_numbers6:=$(foreach i,$(check_p_numbers0),$(addprefix
> $(i),$(check_p_numbers5)))
> -check_p_numbers:=$(check_p_numbers0) $(check_p_numbers2)
> $(check_p_numbers4) $(check_p_numbers6)  check_p_subdir=$(subst _,,$*)
> check_p_subdirs=$(wordlist 1,$(check_p_count),$(wordlist 1, \
>  		$(if
> $(GCC_TEST_PARALLEL_SLOTS),$(GCC_TEST_PARALLEL_SLOTS),128), \
> -		$(check_p_numbers)))
> +		$(one_to_9999)))

Thanks, If it works I'm happy, I can rebase my other patches to use this.

Thank you!

Regards,
Tamar

> 
>  # For parallelized check-% targets, this decides whether parallelization  # is
> desirable (if -jN is used).  If desirable, recursive make is run with
> 
> 
> 	Jakub


  reply	other threads:[~2023-05-05 15:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05 14:59 David Edelsohn
2023-05-05 15:04 ` Jeff Law
2023-05-05 15:08   ` Tamar Christina
2023-05-05 15:13     ` Jeff Law
2023-05-05 15:17   ` Jakub Jelinek
2023-05-05 15:22     ` Tamar Christina
2023-05-05 15:33       ` Jakub Jelinek
2023-05-05 15:37         ` Tamar Christina [this message]
2023-05-05 15:41           ` David Edelsohn
2023-05-05 20:46           ` Jakub Jelinek
2023-05-05 23:32             ` Jeff Law
  -- strict thread matches above, loose matches on Subject: below --
2023-04-28 10:44 Tamar Christina
2023-04-30 19:46 ` Jeff Law
2023-05-02  7:08   ` Tamar Christina
2023-05-03 15:18     ` Kyrylo Tkachov
2023-05-04  9:56       ` Tamar Christina
2023-05-04 23:25         ` Jeff Law
2023-05-05 12:51           ` Tamar Christina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR08MB53258204EBD6A2E1D5ABECCAFF729@VI1PR08MB5325.eurprd08.prod.outlook.com \
    --to=tamar.christina@arm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jeffreyalaw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).