Changeset 0802d69 in OpenModelica


Ignore:
Timestamp:
2021-11-23T14:40:44+01:00 (2 years ago)
Author:
GitHub <noreply@…>
Branches:
maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
d519288
Parents:
0aeaad6
git-author:
perost <perost86@…> (11/23/21 14:40:44)
git-committer:
GitHub <noreply@…> (11/23/21 14:40:44)
Message:

Improve evaluation in ranges (#8203)

  • When evaluating anything in a range in EvalConstants, retype the whole range rather than evaluating the type since it's faster and gives better results, and also fixes some issues with -d=-nfScalarize.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/Compiler/NFFrontEnd/NFEvalConstants.mo

    r57235fb r0802d69  
    207207      then Expression.SIZE(exp.exp, evaluateExpOpt(exp.dimIndex, info));
    208208
     209    case Expression.RANGE()
     210      algorithm
     211        (outExp, outChanged) := Expression.mapFoldShallow(exp,
     212          function evaluateExpTraverser(info = info), false);
     213
     214        // If anything in a range is evaluated its better to just retype it
     215        // rather than evaluating the type, since it's usually faster and gives
     216        // better results in some cases.
     217        if outChanged then
     218          outExp := Expression.retype(outExp);
     219        end if;
     220      then
     221        outExp;
     222
    209223    else
    210224      algorithm
Note: See TracChangeset for help on using the changeset viewer.