Skip to content
Extraits de code Groupes Projets
Valider 10334fa6 rédigé par Nicolas MARIE's avatar Nicolas MARIE
Parcourir les fichiers

remove unused algos

parent a9ff9f3f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -89,10 +89,7 @@ public:
void reset_bb_mark(function *fun);
void alloc_edge_aux(function *fun);
void free_edge_aux(function *fun);
// loop detection algorithms
void __mark_edge_naif(function *fun);
void __mark_edge_naif(basic_block bb);
void __mark_edge_test(function *fun);
// loop detection algorithm
void mark_edge(function *fun);
void mark_edge(basic_block bb);
......
......@@ -92,105 +92,6 @@ void pass_mpi_collective::free_edge_aux(function *fun)
}
// loop detection
// naive version of mark_edge (work but Omax(2^n))
void pass_mpi_collective::__mark_edge_naif(function *fun)
{
__mark_edge_naif(ENTRY_BLOCK_PTR_FOR_FN(fun));
}
void pass_mpi_collective::__mark_edge_naif(basic_block bb)
{
edge e;
edge_iterator ei;
((bb_data *) bb->aux)->mark1 = 1;
FOR_EACH_EDGE(e, ei, bb->succs)
{
if (((bb_data *) e->dest->aux)->mark1)
{
((edge_data *) e->aux)->loop = true;
}
else
{
__mark_edge_naif(e->dest);
}
}
((bb_data *) bb->aux)->mark1 = 0;
}
void pass_mpi_collective::__mark_edge_test(function *fun)
{
edge e1;
edge_iterator ei1;
std::list<basic_block> nodes1;
basic_block bb;
edge e2;
edge_iterator ei2;
std::list<basic_block> nodes2;
basic_block cursor;
int index;
index = 0;
nodes1.push_back(ENTRY_BLOCK_PTR_FOR_FN(fun));
((bb_data *) ENTRY_BLOCK_PTR_FOR_FN(fun)->aux)->mark1 = 1;
while (!nodes1.empty())
{
bb = nodes1.front();
nodes1.pop_front();
FOR_EACH_EDGE(e1, ei1, bb->succs)
{
if (((bb_data *) e1->dest->aux)->mark1)
{
continue;
}
((bb_data *) bb->aux)->mark1 = 1;
nodes1.push_back(e1->dest);
}
if (EDGE_COUNT(bb->preds) < 2)
{
continue;
}
++index;
nodes2.clear();
nodes2.push_back(bb);
((bb_data *) bb->aux)->mark2 = index;
while (!nodes2.empty())
{
cursor = nodes2.front();
nodes2.pop_front();
FOR_EACH_EDGE(e2, ei2, cursor->succs)
{
if (e2->dest == bb)
{
((edge_data *) e2->aux)->loop = true;
}
if (((edge_data *) e2->aux)->loop)
{
continue;
}
if (((bb_data *) e2->dest->aux)->mark2 >= index)
{
continue;
}
((bb_data *) cursor->aux)->mark2 = index;
nodes2.push_back(e2->dest);
}
}
}
reset_bb_mark(fun);
}
void pass_mpi_collective::mark_edge(function *fun)
{
mark_edge(ENTRY_BLOCK_PTR_FOR_FN(fun));
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter