aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/gimple-range-path.cc10
-rw-r--r--gcc/value-relation.cc23
-rw-r--r--gcc/value-relation.h1
3 files changed, 33 insertions, 1 deletions
diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc
index 6942713..5573389 100644
--- a/gcc/gimple-range-path.cc
+++ b/gcc/gimple-range-path.cc
@@ -698,7 +698,15 @@ path_range_query::compute_phi_relations (basic_block bb, basic_block prev)
tree arg = gimple_phi_arg_def (phi, i);
if (gimple_range_ssa_p (arg))
- m_oracle->register_relation (entry, EQ_EXPR, arg, result);
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " from bb%d:", bb->index);
+
+ // Throw away any previous relation.
+ get_path_oracle ()->killing_def (result);
+
+ m_oracle->register_relation (entry, EQ_EXPR, arg, result);
+ }
break;
}
diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc
index ac5f3f9..2acf375 100644
--- a/gcc/value-relation.cc
+++ b/gcc/value-relation.cc
@@ -1285,6 +1285,29 @@ path_oracle::register_equiv (basic_block bb, tree ssa1, tree ssa2)
bitmap_ior_into (m_equiv.m_names, b);
}
+// Register killing definition of an SSA_NAME.
+
+void
+path_oracle::killing_def (tree ssa)
+{
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, " Registering killing_def (path_oracle) ");
+ print_generic_expr (dump_file, ssa, TDF_SLIM);
+ fprintf (dump_file, "\n");
+ }
+
+ bitmap b = BITMAP_ALLOC (&m_bitmaps);
+ bitmap_set_bit (b, SSA_NAME_VERSION (ssa));
+ equiv_chain *ptr = (equiv_chain *) obstack_alloc (&m_chain_obstack,
+ sizeof (equiv_chain));
+ ptr->m_names = b;
+ ptr->m_bb = NULL;
+ ptr->m_next = m_equiv.m_next;
+ m_equiv.m_next = ptr;
+ bitmap_ior_into (m_equiv.m_names, b);
+}
+
// Register relation K between SSA1 and SSA2, resolving unknowns by
// querying from BB.
diff --git a/gcc/value-relation.h b/gcc/value-relation.h
index 53cefbf..97be325 100644
--- a/gcc/value-relation.h
+++ b/gcc/value-relation.h
@@ -222,6 +222,7 @@ public:
~path_oracle ();
const_bitmap equiv_set (tree, basic_block);
void register_relation (basic_block, relation_kind, tree, tree);
+ void killing_def (tree);
relation_kind query_relation (basic_block, tree, tree);
relation_kind query_relation (basic_block, const_bitmap, const_bitmap);
void reset_path ();