[ClavaLaraApi] Adds fix to FindReductionArrays.lara
@@ -51,6 +51,7 @@ aspectdef FindReductionArrays
select $ForStmt.body.expr end
apply
+
call o: retReductionOpArray($expr, candidateArray, isdependentInnerloop, isdependentCurrentloop, isdependentOuterloop);
reduction = o.reduction;
break #$ForStmt;
@@ -79,7 +80,7 @@ end
aspectdef retReductionOpArray
input $expr, candidateVar, isdependentInnerloop, isdependentCurrentloop, isdependentOuterloop end
output reduction end
-
+println("Heello");
reduction = [];
var candidateVarUse = null;
@@ -89,7 +90,9 @@ aspectdef retReductionOpArray
var otherVarUsednumber = 0; // number of other varref in expr
for(var j = 0; j < exprvarrefset.length; j++)
{
- if (exprvarrefset[j].name === candidateVar.name)
+
+ // Fix: Although the array is called exprvarrefset, not all elements are varref (arrayAccess can appear)
+ if (exprvarrefset[j].name === candidateVar.name && exprvarrefset[j].instanceOf("varref"))
{
if (exprvarrefset[j].useExpr.use.indexOf('write') !== -1)
candidateVarUse = exprvarrefset[j].useExpr.code;
