diff options
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index c64e910..e4910a0 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -123,6 +123,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-ssa-ccp.h" #include "stringpool.h" #include "attribs.h" +#include "dbgcnt.h" template <typename valtype> class ipcp_value; @@ -1010,7 +1011,7 @@ ipcp_bits_lattice::set_to_constant (widest_int value, widest_int mask) { gcc_assert (top_p ()); m_lattice_val = IPA_BITS_CONSTANT; - m_value = value; + m_value = wi::bit_and (wi::bit_not (mask), value); m_mask = mask; return true; } @@ -1047,6 +1048,7 @@ ipcp_bits_lattice::meet_with_1 (widest_int value, widest_int mask, widest_int old_mask = m_mask; m_mask = (m_mask | mask) | (m_value ^ value); + m_value &= ~m_mask; if (wi::sext (m_mask, precision) == -1) return set_to_bottom (); @@ -1270,6 +1272,7 @@ initialize_node_lattices (struct cgraph_node *node) plats->ctxlat.set_to_bottom (); set_agg_lats_to_bottom (plats); plats->bits_lattice.set_to_bottom (); + plats->m_value_range.m_vr = value_range (); plats->m_value_range.set_to_bottom (); } else @@ -2735,9 +2738,8 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs, gcc_assert (!jfunc->agg.items); ret |= merge_aggregate_lattices (cs, dest_plats, src_plats, src_idx, 0); + return ret; } - else - ret |= set_agg_lats_contain_variable (dest_plats); } else if (jfunc->type == IPA_JF_ANCESTOR && ipa_get_jf_ancestor_agg_preserved (jfunc)) @@ -2759,8 +2761,10 @@ propagate_aggs_across_jump_function (struct cgraph_edge *cs, ret |= set_agg_lats_to_bottom (dest_plats); else ret |= set_agg_lats_contain_variable (dest_plats); + return ret; } - else if (jfunc->agg.items) + + if (jfunc->agg.items) { bool pre_existing = dest_plats->aggs != NULL; struct ipcp_agg_lattice **aglat = &dest_plats->aggs; @@ -3897,8 +3901,10 @@ ipcp_propagate_stage (class ipa_topo_info *topo) { class ipa_node_params *info = IPA_NODE_REF (node); determine_versionability (node, info); - info->lattices = XCNEWVEC (class ipcp_param_lattices, - ipa_get_param_count (info)); + + unsigned nlattices = ipa_get_param_count (info); + void *chunk = XCNEWVEC (class ipcp_param_lattices, nlattices); + info->lattices = new (chunk) ipcp_param_lattices[nlattices]; initialize_node_lattices (node); } ipa_size_summary *s = ipa_size_summaries->get (node); @@ -4988,11 +4994,7 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index, else intersect_with_agg_replacements (cs->caller, src_idx, &inter, 0); - } - else - { - inter.release (); - return vNULL; + return inter; } } else @@ -5008,11 +5010,7 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index, inter = copy_plats_to_inter (src_plats, 0); else intersect_with_plats (src_plats, &inter, 0); - } - else - { - inter.release (); - return vNULL; + return inter; } } } @@ -5043,8 +5041,10 @@ intersect_aggregates_with_edge (struct cgraph_edge *cs, int index, else intersect_with_plats (src_plats, &inter, delta); } + return inter; } - else if (jfunc->agg.items) + + if (jfunc->agg.items) { class ipa_node_params *caller_info = IPA_NODE_REF (cs->caller); struct ipa_agg_value *item; @@ -5672,8 +5672,9 @@ has_undead_caller_from_outside_scc_p (struct cgraph_node *node, (has_undead_caller_from_outside_scc_p, NULL, true)) return true; else if (!ipa_edge_within_scc (cs) - && !IPA_NODE_REF (cs->caller)->node_dead) - return true; + && (!IPA_NODE_REF (cs->caller) /* Unoptimized caller. */ + || !IPA_NODE_REF (cs->caller)->node_dead)) + return true; return false; } @@ -5789,9 +5790,13 @@ ipcp_store_bits_results (void) ipa_bits *jfbits; if (plats->bits_lattice.constant_p ()) - jfbits - = ipa_get_ipa_bits_for_value (plats->bits_lattice.get_value (), - plats->bits_lattice.get_mask ()); + { + jfbits + = ipa_get_ipa_bits_for_value (plats->bits_lattice.get_value (), + plats->bits_lattice.get_mask ()); + if (!dbg_cnt (ipa_cp_bits)) + jfbits = NULL; + } else jfbits = NULL; |