Commit 25bb194d authored by rpenacob's avatar rpenacob
Browse files

alias final body data structure

parent 3a8cf408
......@@ -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>> &TaskFinalInfo) {
FinalBodyInfoMap &FinalBodyInfo) {
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, TaskFinalInfo.lookup(&DirInfo));
buildFinalCondCFG(M, F, FinalBodyInfo.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>> TaskFinalInfo;
FinalBodyInfoMap FinalBodyInfo;
// 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]);
TaskFinalInfo[&DirInfo].push_back({CloneEntry, CloneExit, &DirInfo});
FinalBodyInfo[&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]);
TaskFinalInfo[&DirInfo].push_back({CloneEntry, CloneExit, &DirInfo});
FinalBodyInfo[&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, TaskFinalInfo);
lowerTask(DirInfo, *F, taskNum++, M, FinalBodyInfo);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment