Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ampere-sw
WP2
LLVM
Commits
25bb194d
Commit
25bb194d
authored
Sep 28, 2020
by
rpenacob
Browse files
alias final body data structure
parent
3a8cf408
Changes
1
Hide whitespace changes
Inline
Side-by-side
llvm/lib/Transforms/OmpSs/OmpSsTransform.cpp
View file @
25bb194d
...
...
@@ -412,6 +412,8 @@ struct OmpSs : public ModulePass {
Instruction
*
CloneExit
;
DirectiveInfo
*
DirInfo
;
};
// For each directive have all inner directives in final context.
using
FinalBodyInfoMap
=
DenseMap
<
DirectiveInfo
*
,
SmallVector
<
FinalBodyInfo
,
4
>>
;
// Signed extension of V to type Ty
static
Value
*
createZSExtOrTrunc
(
IRBuilder
<>
&
IRB
,
Value
*
V
,
Type
*
Ty
,
bool
Signed
)
{
...
...
@@ -1802,7 +1804,7 @@ struct OmpSs : public ModulePass {
Function
&
F
,
size_t
taskNum
,
Module
&
M
,
DenseMap
<
DirectiveInfo
*
,
SmallVector
<
FinalBodyInfo
,
4
>>
&
Task
FinalInfo
)
{
FinalBodyInfo
Map
&
Final
Body
Info
)
{
DebugLoc
DLoc
=
DirInfo
.
Entry
->
getDebugLoc
();
unsigned
Line
=
DLoc
.
getLine
();
...
...
@@ -1813,7 +1815,7 @@ struct OmpSs : public ModulePass {
Constant
*
Nanos6TaskLocStr
=
IRBuilder
<>
(
DirInfo
.
Entry
).
CreateGlobalStringPtr
(
FileNamePlusLoc
);
buildFinalCondCFG
(
M
,
F
,
Task
FinalInfo
.
lookup
(
&
DirInfo
));
buildFinalCondCFG
(
M
,
F
,
Final
Body
Info
.
lookup
(
&
DirInfo
));
BasicBlock
*
EntryBB
=
DirInfo
.
Entry
->
getParent
();
BasicBlock
*
ExitBB
=
DirInfo
.
Exit
->
getParent
()
->
getUniqueSuccessor
();
...
...
@@ -2505,7 +2507,7 @@ struct OmpSs : public ModulePass {
for
(
auto
*
F
:
Functs
)
{
DirectiveFunctionInfo
&
DirectiveFuncInfo
=
getAnalysis
<
OmpSsRegionAnalysisPass
>
(
*
F
).
getFuncInfo
();
DenseMap
<
DirectiveInfo
*
,
SmallVector
<
FinalBodyInfo
,
4
>>
Task
FinalInfo
;
FinalBodyInfo
Map
Final
Body
Info
;
// First sweep to clone BBs
for
(
DirectiveInfo
*
pDirInfo
:
DirectiveFuncInfo
.
PostOrder
)
{
...
...
@@ -2553,13 +2555,13 @@ struct OmpSs : public ModulePass {
Instruction
*
OrigExit
=
DirInfo
.
Exit
;
Instruction
*
CloneEntry
=
cast
<
Instruction
>
(
VMap
[
OrigEntry
]);
Instruction
*
CloneExit
=
cast
<
Instruction
>
(
VMap
[
OrigExit
]);
Task
FinalInfo
[
&
DirInfo
].
push_back
({
CloneEntry
,
CloneExit
,
&
DirInfo
});
Final
Body
Info
[
&
DirInfo
].
push_back
({
CloneEntry
,
CloneExit
,
&
DirInfo
});
for
(
DirectiveInfo
*
InnerTI
:
DirInfo
.
InnerDirectiveInfos
)
{
OrigEntry
=
InnerTI
->
Entry
;
OrigExit
=
InnerTI
->
Exit
;
CloneEntry
=
cast
<
Instruction
>
(
VMap
[
OrigEntry
]);
CloneExit
=
cast
<
Instruction
>
(
VMap
[
OrigExit
]);
Task
FinalInfo
[
&
DirInfo
].
push_back
({
CloneEntry
,
CloneExit
,
&
DirInfo
});
Final
Body
Info
[
&
DirInfo
].
push_back
({
CloneEntry
,
CloneExit
,
&
DirInfo
});
}
// 2. Rewrite ops and branches to cloned ones.
...
...
@@ -2592,7 +2594,7 @@ struct OmpSs : public ModulePass {
else
if
(
DirEnv
.
isOmpSsReleaseDirective
())
lowerRelease
(
DirInfo
,
M
);
else
if
(
DirEnv
.
isOmpSsTaskDirective
())
lowerTask
(
DirInfo
,
*
F
,
taskNum
++
,
M
,
Task
FinalInfo
);
lowerTask
(
DirInfo
,
*
F
,
taskNum
++
,
M
,
Final
Body
Info
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment