Skip to content

Commit

Permalink
[NF] Constant evaluation optimizations.
Browse files Browse the repository at this point in the history
- Added a field to NFExpression.ARRAY that indicates whether an array
  contains only literal expression or not, so that arrays that have
  already been evaluated can be skipped during constant evaluation.
- Implemented Ceval.evalExpPartial that only evaluates the parts of an
  expression that can be evaluated, keeping e.g. iterators intact.
- Use the function mentioned above to optimize the evaluation of array
  constructors and reductions, by partially evaluating the expression
  that's evaluated in each iteration.

Belonging to [master]:
  - OpenModelica/OMCompiler#2812
  • Loading branch information
perost authored and OpenModelica-Hudson committed Dec 3, 2018
1 parent 8b10a66 commit aa64ed4
Show file tree
Hide file tree
Showing 11 changed files with 212 additions and 112 deletions.
2 changes: 1 addition & 1 deletion Compiler/NFFrontEnd/NFBuiltinCall.mo
Expand Up @@ -200,7 +200,7 @@ public
fail();
end if;

arrayExp := Expression.ARRAY(Type.UNKNOWN(), posArgs);
arrayExp := Expression.makeArray(Type.UNKNOWN(), posArgs);
end makeArrayExp;

function makeCatExp
Expand Down

0 comments on commit aa64ed4

Please sign in to comment.