Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Add equation size to vectorized equalities and for loops
Browse files Browse the repository at this point in the history
  • Loading branch information
rfranke authored and OpenModelica-Hudson committed Oct 24, 2018
1 parent 8e8393f commit 743eec1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 2 additions & 9 deletions Compiler/BackEnd/BackendEquation.mo
Expand Up @@ -1664,7 +1664,6 @@ algorithm
osize := match eq
local
list<Integer> ds;
DAE.Exp e1, e2;
Integer size, start, stop;
list<BackendDAE.Equation> eqnsfalse;

Expand Down Expand Up @@ -1694,14 +1693,8 @@ algorithm
size = equationLstSize(eqnsfalse);
then size;

case BackendDAE.FOR_EQUATION(start = e1, stop = e2) equation
if Flags.isSet(Flags.NF_SCALARIZE) then
DAE.ICONST(start) = e1;
DAE.ICONST(stop) = e2;
size = stop - start + 1;
else
size = 1;
end if;
case BackendDAE.FOR_EQUATION(start = DAE.ICONST(start), stop = DAE.ICONST(stop)) equation
size = stop - start + 1;
then size;

else equation
Expand Down
4 changes: 2 additions & 2 deletions Compiler/NFFrontEnd/NFFlatten.mo
Expand Up @@ -635,8 +635,8 @@ algorithm
Integer stop;
Expression range;
case Equation.EQUALITY(lhs = Expression.CREF(), rhs = Expression.CREF())
// let simple equality as is
then eqn;
// convert simple equality of crefs to array equality
then Equation.ARRAY_EQUALITY(eqn.lhs, eqn.rhs, Type.liftArrayLeftList(eqn.ty, dimensions), eqn.source);
else
// wrap general equation into for loop
algorithm
Expand Down

0 comments on commit 743eec1

Please sign in to comment.