STMT_STR: fix dependencies order, handle STMT_STR while replacing

This commit is contained in:
2025-06-14 19:48:50 +03:00
parent 50dd54cec1
commit c26305bf57
2 changed files with 4 additions and 2 deletions

View File

@@ -136,7 +136,9 @@ static void replaceArrayRec(SgSymbol* arr, SgSymbol* replace_by, SgExpression* e
if (!exp)
return;
if (exp->symbol() && exp->symbol()->identifier() && strcmp(exp->symbol()->identifier(), arr->identifier()) == 0)
if (exp->variant() != STMT_STR && exp->symbol() &&
exp->symbol()->identifier() &&
strcmp(exp->symbol()->identifier(), arr->identifier()) == 0)
{
has_read |= from_read;
has_write |= from_write;

View File

@@ -257,7 +257,7 @@ void InitPassesDependencies(map<passes, vector<passes>> &passDepsIn, set<passes>
list({ REVERT_SUBST_EXPR_RD, CONVERT_LOOP_TO_ASSIGN }) <= Pass(RESOLVE_PAR_REGIONS);
list({ REVERT_SUBST_EXPR_RD, CONVERT_LOOP_TO_ASSIGN, FILL_PAR_REGIONS}) <= Pass(REMOVE_DIST_ARRAYS_FROM_IO);
list({ FILL_PAR_REGIONS, REVERT_SUBST_EXPR_RD, CONVERT_LOOP_TO_ASSIGN}) <= Pass(REMOVE_DIST_ARRAYS_FROM_IO);
Pass(REVERT_SUBST_EXPR_RD) <= Pass(EXPAND_EXTRACT_PAR_REGION);