diff --git a/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_parser.cpp b/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_parser.cpp index c93fd31..8666e7b 100644 --- a/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_parser.cpp +++ b/sapfor/experts/Sapfor_2017/_src/DirectiveProcessing/directive_parser.cpp @@ -598,7 +598,6 @@ void fillInfoFromDirectives(const LoopGraph *loopInfo, ParallelDirective *direct void removeOmpDir(void* stIn) { SgStatement* st = (SgStatement*)stIn; - vector resultAll; char* lineS = st->comments(); if (!lineS) diff --git a/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp b/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp index 36afc5b..8449a75 100644 --- a/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp +++ b/sapfor/experts/Sapfor_2017/_src/LoopAnalyzer/loop_analyzer.cpp @@ -2827,7 +2827,9 @@ static void findArrayRefs(SgExpression *ex, SgStatement *st, string fName, int p const auto oldVal = itNew->second.first->GetDistributeFlagVal(); if (oldVal == DIST::DISTR || oldVal == DIST::NO_DISTR) { - if (privates.find(symb->identifier()) != privates.end() || itNew->second.first->IsOmpThreadPrivate()) + if (itNew->second.first->IsOmpThreadPrivate()) + itNew->second.first->SetDistributeFlag(DIST::SPF_PRIV); + else if (privates.find(symb->identifier()) != privates.end()) { //check in module if (itNew->second.first->GetLocation().first == DIST::l_MODULE) diff --git a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp index d02e199..3d27c54 100644 --- a/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Sapfor.cpp @@ -1145,6 +1145,11 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne groupActualAndRemote(file, true); else if (curr_regime == RENAME_SYMBOLS) runRenameSymbolsByFiles(file, &project); + else if (curr_regime == REMOVE_OMP_DIRS) + { + for (SgStatement* st = file->firstStatement(); st; st = st->lexNext()) + removeOmpDir(st); + } else if (curr_regime == TEST_PASS) { //test pass diff --git a/sapfor/experts/Sapfor_2017/_src/Sapfor.h b/sapfor/experts/Sapfor_2017/_src/Sapfor.h index 957a1f8..e21d2f1 100644 --- a/sapfor/experts/Sapfor_2017/_src/Sapfor.h +++ b/sapfor/experts/Sapfor_2017/_src/Sapfor.h @@ -167,6 +167,7 @@ enum passes { PRIVATE_ANALYSIS_IR, FIX_COMMON_BLOCKS, + REMOVE_OMP_DIRS, TEST_PASS, EMPTY_PASS @@ -339,6 +340,7 @@ static void setPassValues() passNames[PRIVATE_ANALYSIS_IR] = "PRIVATE_ANALYSIS_IR"; passNames[FIX_COMMON_BLOCKS] = "FIX_COMMON_BLOCKS"; + passNames[REMOVE_OMP_DIRS] = "REMOVE_OMP_DIRS"; passNames[TEST_PASS] = "TEST_PASS"; } diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/PassManager.h b/sapfor/experts/Sapfor_2017/_src/Utils/PassManager.h index bed858c..b00d64a 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/PassManager.h +++ b/sapfor/experts/Sapfor_2017/_src/Utils/PassManager.h @@ -232,7 +232,7 @@ void InitPassesDependencies(map> &passDepsIn, set list({ GET_ALL_ARRAY_DECL, CALL_GRAPH2, CODE_CHECKER_PASSES, SUBST_EXPR_RD, ARRAY_ACCESS_ANALYSIS_FOR_CORNER }) <= list({ LOOP_ANALYZER_NODIST, LOOP_ANALYZER_DATA_DIST_S0, LOOP_ANALYZER_DATA_DIST_S1, ONLY_ARRAY_GRAPH }); - Pass(LOOP_ANALYZER_NODIST) <= Pass(INSERT_PARALLEL_DIRS_NODIST); + list({ LOOP_ANALYZER_NODIST, REMOVE_OMP_DIRS }) <= Pass(INSERT_PARALLEL_DIRS_NODIST); Pass(CHECK_ARGS_DECL) <= Pass(CREATE_TEMPLATE_LINKS); @@ -262,7 +262,7 @@ void InitPassesDependencies(map> &passDepsIn, set list({ PREPROC_SPF, CORRECT_VAR_DECL }) <= Pass(FILL_PAR_REGIONS_LINES); - Pass(LOOP_ANALYZER_COMP_DIST) <= list({ CREATE_DISTR_DIRS, CREATE_PARALLEL_DIRS, INSERT_PARALLEL_DIRS }); + list({ LOOP_ANALYZER_COMP_DIST, REMOVE_OMP_DIRS }) <= list({ CREATE_DISTR_DIRS, CREATE_PARALLEL_DIRS, INSERT_PARALLEL_DIRS }); Pass(CALL_GRAPH2) <= list({ ONLY_ARRAY_GRAPH, CREATE_NESTED_LOOPS, FIND_FUNC_TO_INCLUDE, CHECK_FUNC_TO_INCLUDE, FIND_PARAMETERS }); diff --git a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp index b8d95c6..b6be2cd 100644 --- a/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp +++ b/sapfor/experts/Sapfor_2017/_src/Utils/SgUtils.cpp @@ -402,7 +402,6 @@ string removeIncludeStatsAndUnparse(SgFile *file, const char *fileName, const ch for (SgStatement *st = file->firstStatement(); st; st = st->lexNext()) { - removeOmpDir(st); if (st->lineNumber() <= 0 || st->variant() < 0) continue; string currFileName = st->fileName();