Skip to content

Dependence graph now tracks a function identifier [blocks: #3126] #3864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/analyses/dependence_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ bool dep_graph_domaint::merge(
}

void dep_graph_domaint::control_dependencies(
const irep_idt &function_id,
goto_programt::const_targett from,
goto_programt::const_targett to,
dependence_grapht &dep_graph)
Expand Down Expand Up @@ -82,7 +83,7 @@ void dep_graph_domaint::control_dependencies(

// Get postdominators

const irep_idt id=from->function;
const irep_idt id = function_id;
const cfg_post_dominatorst &pd=dep_graph.cfg_post_dominators().at(id);

// Check all candidates
Expand Down Expand Up @@ -151,6 +152,7 @@ static bool may_be_def_use_pair(

void dep_graph_domaint::data_dependencies(
goto_programt::const_targett,
const irep_idt &function_to,
goto_programt::const_targett to,
dependence_grapht &dep_graph,
const namespacet &ns)
Expand All @@ -162,7 +164,7 @@ void dep_graph_domaint::data_dependencies(
value_setst &value_sets=
dep_graph.reaching_definitions().get_value_sets();
rw_range_set_value_sett rw_set(ns, value_sets);
goto_rw(to->function, to, rw_set);
goto_rw(function_to, to, rw_set);

forall_rw_range_set_r_objects(it, rw_set)
{
Expand Down Expand Up @@ -205,7 +207,7 @@ void dep_graph_domaint::transform(
{
if(function_from == function_to)
{
control_dependencies(from, to, *dep_graph);
control_dependencies(function_from, from, to, *dep_graph);
}
else
{
Expand All @@ -231,9 +233,9 @@ void dep_graph_domaint::transform(
}
}
else
control_dependencies(from, to, *dep_graph);
control_dependencies(function_from, from, to, *dep_graph);

data_dependencies(from, to, *dep_graph, ns);
data_dependencies(from, function_to, to, *dep_graph, ns);
}

void dep_graph_domaint::output(
Expand Down
2 changes: 2 additions & 0 deletions src/analyses/dependence_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,14 @@ class dep_graph_domaint:public ai_domain_baset
dependence_graph_test_get_data_deps(const dep_graph_domaint &);

void control_dependencies(
const irep_idt &function_id,
goto_programt::const_targett from,
goto_programt::const_targett to,
dependence_grapht &dep_graph);

void data_dependencies(
goto_programt::const_targett from,
const irep_idt &function_to,
goto_programt::const_targett to,
dependence_grapht &dep_graph,
const namespacet &ns);
Expand Down