1 Commits

Author SHA1 Message Date
7b5873af9e ArrayAnalysis: consider case of IO_PRIV array from module 2025-09-10 22:23:43 +03:00
2 changed files with 12 additions and 6 deletions

View File

@@ -241,15 +241,13 @@ static void findArrayRefs (SgExpression* ex, SgStatement* st, string fName, int
itNew->second.first->SetRegionPlace(reg); itNew->second.first->SetRegionPlace(reg);
const auto oldVal = itNew->second.first->GetDistributeFlagVal(); const auto oldVal = itNew->second.first->GetDistributeFlagVal();
bool isArrayInModule = (itNew->second.first->GetLocation().first == DIST::l_MODULE); bool isarrayInModule = (itNew->second.first->GetLocation().first == DIST::l_MODULE);
if (oldVal == DIST::DISTR || oldVal == DIST::NO_DISTR) if (oldVal == DIST::DISTR || oldVal == DIST::NO_DISTR)
{ {
if (itNew->second.first->IsOmpThreadPrivate()) if (itNew->second.first->IsOmpThreadPrivate())
itNew->second.first->SetDistributeFlag(DIST::SPF_PRIV); itNew->second.first->SetDistributeFlag(DIST::SPF_PRIV);
else if (deprecatedByIO.find(symb->identifier()) != deprecatedByIO.end()) else if (privates.find(symb->identifier()) != privates.end() || isarrayInModule)
itNew->second.first->SetDistributeFlag(DIST::IO_PRIV);
else if (isArrayInModule || privates.find(symb->identifier()) != privates.end())
{ {
//check in module //check in module
if (itNew->second.first->GetLocation().first == DIST::l_MODULE) if (itNew->second.first->GetLocation().first == DIST::l_MODULE)
@@ -272,10 +270,18 @@ static void findArrayRefs (SgExpression* ex, SgStatement* st, string fName, int
fillPrivatesFromComment(new Statement(prev), privatesS); fillPrivatesFromComment(new Statement(prev), privatesS);
if (privatesS.find(symb->identifier()) != privatesS.end()) if (privatesS.find(symb->identifier()) != privatesS.end())
itNew->second.first->SetDistributeFlag(DIST::SPF_PRIV); itNew->second.first->SetDistributeFlag(DIST::SPF_PRIV);
if (!(itNew->second.first->IsNotDistribute()) &&
deprecatedByIO.find(symb->identifier()) != deprecatedByIO.end())
{
itNew->second.first->SetDistributeFlag(DIST::IO_PRIV);
}
} }
else else
itNew->second.first->SetDistributeFlag(DIST::SPF_PRIV); itNew->second.first->SetDistributeFlag(DIST::SPF_PRIV);
} }
else if (deprecatedByIO.find(symb->identifier()) != deprecatedByIO.end())
itNew->second.first->SetDistributeFlag(DIST::IO_PRIV);
else if (isSgConstantSymb(symb) || inDataStat) else if (isSgConstantSymb(symb) || inDataStat)
itNew->second.first->SetDistributeFlag(DIST::SPF_PRIV); itNew->second.first->SetDistributeFlag(DIST::SPF_PRIV);
else else

View File

@@ -1,3 +1,3 @@
#pragma once #pragma once
#define VERSION_SPF "2442" #define VERSION_SPF "2441"