public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/3] genmatch: Speed up recompilation after changes to match.pd
@ 2023-07-31 11:03 Andrzej Turko
  2023-07-31 11:03 ` [PATCH 1/3] Support get_or_insert in ordered_hash_map Andrzej Turko
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andrzej Turko @ 2023-07-31 11:03 UTC (permalink / raw)
  To: gcc-patches; +Cc: Andrzej Turko

The following reduces the number of object files that need to be rebuilt
after match.pd has been modified. Right now a change to match.pd which
adds/removes a line almost always forces recompilation of all files that
genmatch generates from it. This is because of unnecessary changes to
the generated .cc files:

1. Function names and ordering change as does the way the functions are
        distributed across multiple source files.
2. Code locations from match.pd are quoted directly (including line
        numbers) by logging fprintf calls.

This patch addresses the those issues without changing the behaviour
of the generated code. The first one is solved by making sure that minor
changes to match.pd do not influence the order in which functions are
generated. The second one by using a lookup table with line numbers.

Now a change to a single function will trigger a rebuild of 4 object
files (one with the function  and the one with the lookup table both for
gimple and generic) instead all of them (20 by default).
For reference, this decreased the rebuild time with 48 threads from 3.5
minutes to 1.5 minutes on my machine.


Note for reviewers: I do not have write access.

Andrzej Turko (3):
  Support get_or_insert in ordered_hash_map
  genmatch: Reduce variability of generated code
  genmatch: Log line numbers indirectly

 gcc/Makefile.in               |  4 +-
 gcc/genmatch.cc               | 76 ++++++++++++++++++++++++++++++-----
 gcc/ordered-hash-map-tests.cc | 19 +++++++--
 gcc/ordered-hash-map.h        | 26 ++++++++++++
 4 files changed, 110 insertions(+), 15 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-03 14:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31 11:03 [PATCH 0/3] genmatch: Speed up recompilation after changes to match.pd Andrzej Turko
2023-07-31 11:03 ` [PATCH 1/3] Support get_or_insert in ordered_hash_map Andrzej Turko
2023-07-31 13:38   ` Richard Biener
2023-07-31 11:03 ` [PATCH 2/3] genmatch: Reduce variability of generated code Andrzej Turko
2023-07-31 13:40   ` Richard Biener
2023-07-31 11:03 ` [PATCH 3/3] genmatch: Log line numbers indirectly Andrzej Turko
2023-07-31 13:48   ` Richard Biener
2023-08-03 14:31     ` Andrzej Turko

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).