Hi,

When building vectors of known aggregate values, there is no point in
including those for parameters which are not used in any way
whatsoever.

Bootstrapped and tested on x86_64-linux.  OK for master?

Thanks,

Martin


gcc/ChangeLog:

2022-11-11  Martin Jambor  <mjam...@suse.cz>

        * ipa-cp.cc (push_agg_values_from_edge): Do not consider constants
        in unused aggregate parameters.
---
 gcc/ipa-cp.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc
index d2bcd5e5e69..02bd6a0fd1a 100644
--- a/gcc/ipa-cp.cc
+++ b/gcc/ipa-cp.cc
@@ -5783,7 +5783,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, interim);
     }
-- 
2.38.0

Reply via email to