aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-22 17:43:43 -0300
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-22 17:43:43 -0300
commita926878ddbd5a98b272c22171ce58663fc04c3e0 (patch)
tree86af256e5d9a9c06263c00adc90e5fe348008c43 /gcc/ipa-cp.c
parent542730f087133690b47e036dfd43eb0db8a650ce (diff)
parent07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1 (diff)
downloadgcc-devel/autopar_devel.zip
gcc-devel/autopar_devel.tar.gz
gcc-devel/autopar_devel.tar.bz2
Merge branch 'autopar_rebase2' into autopar_develdevel/autopar_devel
Quickly commit changes in the rebase branch.
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c49
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;