public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/pheeck/heads/sccp)] ipa-cp: Do not consider useless aggregate constants
@ 2023-02-15 10:19 Filip Kastl
0 siblings, 0 replies; only message in thread
From: Filip Kastl @ 2023-02-15 10:19 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:bc67858c5c9b43038922fe3b675c2f80141f2426
commit bc67858c5c9b43038922fe3b675c2f80141f2426
Author: Martin Jambor <mjambor@suse.cz>
Date: Tue Nov 22 18:22:03 2022 +0100
ipa-cp: Do not consider useless aggregate constants
When building vectors of known aggregate values, there is no point in
including those for parameters which are not used in any way
whatsoever. This patch avoids that together with also other kinds of
constants.
gcc/ChangeLog:
2022-11-13 Martin Jambor <mjambor@suse.cz>
* ipa-cp.cc (push_agg_values_from_edge): Do not consider constants
in unused aggregate parameters.
Diff:
---
gcc/ipa-cp.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index f0feb4beb8f..d5230c7c5e6 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -5785,7 +5785,8 @@ push_agg_values_from_edge (struct cgraph_edge *cs,
}
ipcp_param_lattices *plats = ipa_get_parm_lattices (dest_info, index);
- if (plats->aggs_bottom)
+ if (!ipa_is_param_used (dest_info, index)
+ || plats->aggs_bottom)
continue;
push_agg_values_for_index_from_edge (cs, index, res,
optimize_self_recursion ? interim
@@ -6151,6 +6152,9 @@ decide_whether_version_node (struct cgraph_node *node)
for (i = 0; i < count;i++)
{
+ if (!ipa_is_param_used (info, i))
+ continue;
+
class ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i);
ipcp_lattice<tree> *lat = &plats->itself;
ipcp_lattice<ipa_polymorphic_call_context> *ctxlat = &plats->ctxlat;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-02-15 10:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 10:19 [gcc(refs/users/pheeck/heads/sccp)] ipa-cp: Do not consider useless aggregate constants Filip Kastl
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).