Skip to content

Commit

Permalink
- add simplification rules for DIV_ARR and DIV_ARRAY_SCALAR
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18161 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Nov 17, 2013
1 parent c9ee1aa commit 9b6274a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Compiler/FrontEnd/ExpressionSimplify.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,20 @@ algorithm
a1 = Expression.makeConstZero(tp);
then a1;

case (e1,op as DAE.DIV_ARR(ty = _),e2)
equation
true = Expression.isZero(e1);
tp = Expression.typeof(e1);
(a1, _) = Expression.makeZeroExpression(Expression.arrayDimension(tp));
then a1;

case (e1,op as DAE.DIV_ARRAY_SCALAR(ty = _),e2)
equation
true = Expression.isZero(e1);
tp = Expression.typeof(e1);
(a1, _) = Expression.makeZeroExpression(Expression.arrayDimension(tp));
then a1;

end matchcontinue;
end simplifyBinaryArray;

Expand Down

0 comments on commit 9b6274a

Please sign in to comment.