Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
C
COAV2023
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Anzo
COAV2023
Validations
3747714d
Valider
3747714d
rédigé
Il y a 1 an
par
Nicolas MARIE
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
add dominance frontier compute
parent
8404639a
Branches
Branches contenant la validation
Étiquettes
Étiquettes contenant la validation
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
include/pass_mpi_collective.hpp
+8
-6
8 ajouts, 6 suppressions
include/pass_mpi_collective.hpp
src/pass_mpi_collective.cpp
+93
-5
93 ajouts, 5 suppressions
src/pass_mpi_collective.cpp
avec
101 ajouts
et
11 suppressions
include/pass_mpi_collective.hpp
+
8
−
6
Voir le fichier @
3747714d
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
#include
<gcc-plugin.h>
#include
<gcc-plugin.h>
// declare opt_pass
// declare opt_pass
#include
<tree-pass.h>
#include
<tree-pass.h>
//
vector
//
set
#include
<
vector
>
#include
<
set
>
/* Enum to represent the collective operations */
/* Enum to represent the collective operations */
#define DEFMPICOLLECTIVES(CODE, NAME) CODE,
#define DEFMPICOLLECTIVES(CODE, NAME) CODE,
...
@@ -25,10 +25,10 @@ const char *const mpi_collective_name[] =
...
@@ -25,10 +25,10 @@ const char *const mpi_collective_name[] =
struct
bb_data
struct
bb_data
{
{
mpi_collective_code
mpi_code
;
mpi_collective_code
mpi_code
;
std
::
vector
<
basic_block
>
dom
;
std
::
set
<
basic_block
>
dom
;
std
::
vector
<
basic_block
>
post_dom
;
std
::
set
<
basic_block
>
post_dom
;
std
::
vector
<
basic_block
>
dom_front
;
std
::
set
<
basic_block
>
dom_front
;
std
::
vector
<
basic_block
>
post_dom_front
;
std
::
set
<
basic_block
>
post_dom_front
;
};
};
class
pass_mpi_collective
:
public
opt_pass
class
pass_mpi_collective
:
public
opt_pass
...
@@ -59,6 +59,8 @@ public:
...
@@ -59,6 +59,8 @@ public:
// calculate dominances
// calculate dominances
void
label_dom
(
function
*
fun
);
void
label_dom
(
function
*
fun
);
void
compute_dominance_frontiers
(
function
*
fun
);
void
compute_post_dominance_frontiers
(
function
*
fun
);
void
free_dom_data
();
void
free_dom_data
();
private:
private:
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/pass_mpi_collective.cpp
+
93
−
5
Voir le fichier @
3747714d
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
#include
<gimple-iterator.h>
#include
<gimple-iterator.h>
// basename
// basename
#include
<filesystem>
#include
<filesystem>
//
vector
//
set
#include
<
vector
>
#include
<
set
>
// our pass
// our pass
#include
"pass_mpi_collective.hpp"
#include
"pass_mpi_collective.hpp"
...
@@ -59,6 +59,8 @@ unsigned int pass_mpi_collective::execute(function *fun)
...
@@ -59,6 +59,8 @@ unsigned int pass_mpi_collective::execute(function *fun)
alloc_bb_aux
(
fun
);
alloc_bb_aux
(
fun
);
label_collec
(
fun
);
label_collec
(
fun
);
label_dom
(
fun
);
label_dom
(
fun
);
compute_dominance_frontiers
(
fun
);
compute_post_dominance_frontiers
(
fun
);
cfgviz_dump
(
fun
,
"_split"
);
cfgviz_dump
(
fun
,
"_split"
);
free_dom_data
();
free_dom_data
();
...
@@ -245,7 +247,7 @@ void pass_mpi_collective::label_dom(function *fun)
...
@@ -245,7 +247,7 @@ void pass_mpi_collective::label_dom(function *fun)
{
{
if
(
dom_gccvec
[
i
]
->
index
!=
bb
->
index
)
if
(
dom_gccvec
[
i
]
->
index
!=
bb
->
index
)
{
{
data
->
dom
.
push_back
(
dom_gccvec
[
i
]);
data
->
dom
.
insert
(
dom_gccvec
[
i
]);
}
}
}
}
...
@@ -261,7 +263,7 @@ void pass_mpi_collective::label_dom(function *fun)
...
@@ -261,7 +263,7 @@ void pass_mpi_collective::label_dom(function *fun)
{
{
if
(
post_dom_gccvec
[
i
]
->
index
!=
bb
->
index
)
if
(
post_dom_gccvec
[
i
]
->
index
!=
bb
->
index
)
{
{
data
->
post_dom
.
push_back
(
post_dom_gccvec
[
i
]);
data
->
post_dom
.
insert
(
post_dom_gccvec
[
i
]);
}
}
}
}
//for (basic_block bb2 : *post_dom)
//for (basic_block bb2 : *post_dom)
...
@@ -272,6 +274,72 @@ void pass_mpi_collective::label_dom(function *fun)
...
@@ -272,6 +274,72 @@ void pass_mpi_collective::label_dom(function *fun)
}
}
}
}
void
pass_mpi_collective
::
compute_dominance_frontiers
(
function
*
fun
)
{
edge
p
;
edge_iterator
ei
;
basic_block
b
;
FOR_EACH_BB_FN
(
b
,
fun
)
{
if
(
EDGE_COUNT
(
b
->
preds
)
>=
2
)
{
basic_block
domsb
=
get_immediate_dominator
(
CDI_DOMINATORS
,
b
);
FOR_EACH_EDGE
(
p
,
ei
,
b
->
preds
)
{
basic_block
runner
=
p
->
src
;
if
(
runner
==
ENTRY_BLOCK_PTR_FOR_FN
(
fun
))
{
continue
;
}
while
(
runner
!=
domsb
)
{
bb_data
*
data
=
(
bb_data
*
)
runner
->
aux
;
if
(
data
->
dom_front
.
count
(
b
)
>
0
)
{
break
;
}
data
->
dom_front
.
insert
(
b
);
runner
=
get_immediate_dominator
(
CDI_DOMINATORS
,
runner
);
}
}
}
}
}
void
pass_mpi_collective
::
compute_post_dominance_frontiers
(
function
*
fun
)
{
edge
p
;
edge_iterator
ei
;
basic_block
b
;
FOR_EACH_BB_FN
(
b
,
fun
)
{
if
(
EDGE_COUNT
(
b
->
succs
)
>=
2
)
{
basic_block
domsb
=
get_immediate_dominator
(
CDI_POST_DOMINATORS
,
b
);
FOR_EACH_EDGE
(
p
,
ei
,
b
->
succs
)
{
basic_block
runner
=
p
->
dest
;
if
(
runner
==
EXIT_BLOCK_PTR_FOR_FN
(
fun
))
{
continue
;
}
while
(
runner
!=
domsb
)
{
bb_data
*
data
=
(
bb_data
*
)
runner
->
aux
;
if
(
data
->
post_dom_front
.
count
(
b
)
>
0
)
{
break
;
}
data
->
post_dom_front
.
insert
(
b
);
runner
=
get_immediate_dominator
(
CDI_POST_DOMINATORS
,
runner
);
}
}
}
}
}
void
pass_mpi_collective
::
free_dom_data
()
void
pass_mpi_collective
::
free_dom_data
()
{
{
free_dominance_info
(
CDI_DOMINATORS
);
free_dominance_info
(
CDI_DOMINATORS
);
...
@@ -342,6 +410,26 @@ void pass_mpi_collective::cfgviz_internal_dump(function *fun, FILE *out)
...
@@ -342,6 +410,26 @@ void pass_mpi_collective::cfgviz_internal_dump(function *fun, FILE *out)
fprintf
(
out
,
")"
);
fprintf
(
out
,
")"
);
}
}
if
(
!
data
->
dom_front
.
empty
())
{
fprintf
(
out
,
"|dom_front("
);
for
(
basic_block
bb2
:
data
->
dom_front
)
{
fprintf
(
out
,
"%d,"
,
bb2
->
index
);
}
fprintf
(
out
,
")"
);
}
if
(
!
data
->
post_dom_front
.
empty
())
{
fprintf
(
out
,
"|post_dom_front("
);
for
(
basic_block
bb2
:
data
->
post_dom_front
)
{
fprintf
(
out
,
"%d,"
,
bb2
->
index
);
}
fprintf
(
out
,
")"
);
}
fprintf
(
out
,
"
\"
shape=ellipse]
\n
"
);
fprintf
(
out
,
"
\"
shape=ellipse]
\n
"
);
FOR_EACH_EDGE
(
e
,
eit
,
bb
->
succs
)
FOR_EACH_EDGE
(
e
,
eit
,
bb
->
succs
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter