fixed privates analysis

This commit is contained in:
ALEXks
2023-10-27 20:12:02 +03:00
parent 91788bd09e
commit ec2975a2ed
4 changed files with 13 additions and 10 deletions

View File

@@ -7645,14 +7645,14 @@ SgExpression *CalculateArrayBound(SgExpression *edim, SgSymbol *ar, int flag_pri
SgSubscriptExp *sbe;
SgExpression *low;
if (!edim && flag_private)
{
{
// Error("Illegal array bound of private/reduction array %s", ar->identifier(), 442, dvm_parallel_dir);
return (edim);
}
if ((sbe = isSgSubscriptExp(edim)) != NULL){ //DDOT
if (!sbe->ubound() && flag_private)
{
{
// Error("Illegal array bound of private/reduction array %s", ar->identifier(), 442, dvm_parallel_dir);
return(edim);
}
@@ -7675,8 +7675,8 @@ SgExpression *CalculateArrayBound(SgExpression *edim, SgSymbol *ar, int flag_pri
}
else
{
edim = Calculate(edim);
if (edim->variant() != INT_VAL && flag_private )
edim = Calculate(edim);
// if (edim->variant() != INT_VAL && flag_private )
// Error("Illegal array bound of private/reduction array %s", ar->identifier(), 442, dvm_parallel_dir);
return (edim);
}
@@ -11095,10 +11095,13 @@ SgExpression *BlockDimsProduct()
{
return &(*new SgRecordRefExp(*s_blockdim, "x") * *new SgRecordRefExp(*s_blockdim, "y") * *new SgRecordRefExp(*s_blockdim, "z"));
}
SgExpression *LowerShiftForArrays (SgSymbol *ar, int i, int type)
{
SgExpression *e = isConstantBound(ar, i, 1);
SgExpression *e = isConstantBound(ar, i, 1);
if(e) return e;
if(type==0) //private array
e = new SgValueExp(1);
else // reduction array
e = &(((SgExprListExp *)red_struct_list->lowBound_arg)->elem(i)->copy());
return e;

View File

@@ -208,7 +208,7 @@ static void addInListIfNeed(SgSymbol *tmp, int type, reduction_operation_list *t
while (dimList)
{
allArraySub.push(dimList->lhs());
allArraySubConv.push(make_pair(LowerShiftForArrays(tmp, rank), UpperShiftForArrays(tmp, rank)));
allArraySubConv.push(make_pair(LowerShiftForArrays(tmp, rank, type), UpperShiftForArrays(tmp, rank)));
++rank;
dimList = dimList->rhs();
}
@@ -222,7 +222,7 @@ static void addInListIfNeed(SgSymbol *tmp, int type, reduction_operation_list *t
bool ddot = false;
if (ex->variant() == DDOT && ex->lhs() || IS_ALLOCATABLE(tmp))
ddot = true;
t.correctExp.push_back(LowerShiftForArrays(tmp, rank));
t.correctExp.push_back(LowerShiftForArrays(tmp, rank, type));
// swap array's dimentionss
if (inNewVars(tmp->identifier()))

View File

@@ -1390,7 +1390,7 @@ void RefInImplicitLoop(SgExpression *eim, int mode);
void RefInImplicitLoop(SgExpression *eim, int mode);
SgSymbol *dvm000SymbolForHost(int host_dvm, SgStatement *hedr);
SgExpression *Red_grid_index(SgSymbol *sind);
SgExpression *BlockDimsProduct();
SgExpression *BlockDimsProduct();
SgExpression *LowerShiftForArrays (SgSymbol *ar, int i, int type);
SgExpression *UpperShiftForArrays (SgSymbol *ar, int i);
SgExpression *coefProd(int i, SgExpression *ec);

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2228"
#define VERSION_SPF "2229"