From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Add --import-optimize/--no-import-optimize
Date: Wed, 01 Jan 2020 00:00:00 -0000 [thread overview]
Message-ID: <20200125223631.GA18433@delia> (raw)
Hi,
The function create_import_tree attempts to reduce the number of
DW_TAG_imported_unit DIEs.
Add command line options --import-optimize/--no-opt-importize to control this
optimization.
Committed to trunk.
Thanks,
- Tom
Add --import-optimize/--no-import-optimize
2020-01-24 Tom de Vries <tdevries@suse.de>
* dwz.1: Add --import-optimize/--no-import-optimize entry.
* dwz.c (import_opt_p): New variable.
(create_import_tree): Move freeing of seen variable to ASAP instead
of ALAP. Guard optimization part with import_opt_p.
(dwz_options, dwz_common_options_help): Add
--import-optimize/--no-import-optimize.
---
dwz.1 | 8 ++++++++
dwz.c | 17 +++++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/dwz.1 b/dwz.1
index 3df7e59..b48bc02 100644
--- a/dwz.1
+++ b/dwz.1
@@ -105,6 +105,14 @@ In normal operation, the link setting should be used. The basic setting is
provided only as fallback in case of problems with the link setting. Set to
link by default.
.TP
+.B \-\-import-optimize / \-\-no-import-optimize
+Enable/disable optimization that reduces the number of
+\fIDW_TAG_imported_unit\fR DIEs generated to import the partial units created
+by \fBdwz\fR. Disabling the optimization can be used to work around problems
+in the optimization, or to make it easier to observe which CU imports which
+PU.
+Enabled by default.
+.TP
.B \-? \-\-help
Print short help and exit.
.TP
diff --git a/dwz.c b/dwz.c
index a81e42a..bffbaa1 100644
--- a/dwz.c
+++ b/dwz.c
@@ -210,6 +210,7 @@ static int verify_edges_p = 0;
static int dump_edges_p = 0;
static int partition_dups_opt;
static int progress_p;
+static int import_opt_p = 1;
enum die_count_methods
{
none,
@@ -7859,6 +7860,8 @@ create_import_tree (void)
dump_edges ("phase 1", ipus, npus, ncus);
if (unlikely (verify_edges_p))
verify_edges (ipus, npus, ncus, 1);
+ if (!import_opt_p)
+ goto opt_done;
if (unlikely (progress_p))
{
report_progress ();
@@ -8371,10 +8374,12 @@ create_import_tree (void)
max_seen = 0;
}
}
+ free (seen);
if (unlikely (dump_edges_p))
dump_edges ("phase 3", ipus, npus, ncus);
if (unlikely (verify_edges_p))
verify_edges (ipus, npus, ncus, 3);
+ opt_done:
if (unlikely (progress_p))
{
report_progress ();
@@ -8457,7 +8462,6 @@ create_import_tree (void)
for (cu = alt_first_cu; cu; cu = cu->cu_next)
cu->u1.cu_icu = NULL;
obstack_free (&ob2, to_free);
- free (seen);
return 0;
}
@@ -14451,6 +14455,10 @@ static struct option dwz_options[] =
{ "multifile-name", required_argument, 0, 'M' },
{ "relative", no_argument, 0, 'r' },
{ "version", no_argument, 0, 'v' },
+ { "import-optimization",
+ no_argument, &import_opt_p, 1 },
+ { "no-import-optimization",
+ no_argument, &import_opt_p, 0 },
#if DEVEL
{ "devel-trace", no_argument, &tracing, 1 },
{ "devel-progress", no_argument, &progress_p, 1 },
@@ -14502,7 +14510,12 @@ static struct option_help dwz_common_options_help[] =
{ NULL, "no-odr", NULL, "Enabled",
"Enable/disable one definition rule optimization." },
{ NULL, "odr-mode", "<basic|link>", "link",
- "Set aggressiveness level of one definition rule optimization." }
+ "Set aggressiveness level of one definition rule optimization." },
+ { NULL, "import-optimization", NULL, NULL,
+ NULL },
+ { NULL, "no-import-optimization", NULL, "Enabled",
+ "Enable/disable optimization that reduces the number of"
+ " DW_TAG_imported_unit DIEs." }
};
/* Describe single-file command line options. */
reply other threads:[~2020-01-25 22:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200125223631.GA18433@delia \
--to=tdevries@suse.de \
--cc=dwz@sourceware.org \
--cc=jakub@redhat.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).