This commit is contained in:
2025-12-21 03:57:57 +03:00
parent a07a701826
commit 93fa183b63

View File

@@ -124,26 +124,13 @@ static int GetDefUseArray(SAPFOR::BasicBlock* block, LoopGraph* loop, ArrayAcces
vector<ArrayDimension> accessPoint(n);
auto* ref = isSgArrayRefExp(instruction->getInstruction()->getExpression());
vector<pair<int, int>> coefsForDims;
int subs = ref->numberOfSubscripts();
for (int i = 0; ref && i < ref->numberOfSubscripts(); ++i)
{
const vector<int*>& coefs = getAttributes<SgExpression*, int*>(ref->subscript(i), set<int>{ INT_VAL });
if (coefs.size() == 1)
{
const pair<int, int> coef(coefs[0][0], coefs[0][1]);
coefsForDims.push_back(coef);
}
}
int fillCount = 0;
while (!index_vars.empty() && !refPos.empty() && !coefsForDims.empty())
while (!index_vars.empty() && !refPos.empty())
{
auto var = index_vars.back();
int currentVarPos = refPos.back();
pair<int, int> currentCoefs = coefsForDims.back();
ArrayDimension current_dim;
if (var->getType() == SAPFOR::CFG_ARG_TYPE::CONST)
current_dim = { stoul(var->getValue()), 1, 1, ref};
@@ -185,7 +172,6 @@ static int GetDefUseArray(SAPFOR::BasicBlock* block, LoopGraph* loop, ArrayAcces
}
index_vars.pop_back();
refPos.pop_back();
coefsForDims.pop_back();
}
if (fillCount == accessPoint.size())