Skip to content

Commit

Permalink
- CevalScript.generateFunctions speed-up (breaks error messages in on…
Browse files Browse the repository at this point in the history
…e testcase)

  - This change is needed (or something similar); the speed-up for bootstrapping is ~100 times
- Fixes for bootstrapping


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7022 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 14, 2010
1 parent b531fa8 commit 2ab96fd
Show file tree
Hide file tree
Showing 7 changed files with 450 additions and 346 deletions.
4 changes: 2 additions & 2 deletions Compiler/BackendDAEOptimize.mo
Expand Up @@ -179,7 +179,7 @@ protected function removeSimpleEquations2
output DAE.Exp e1;
output DAE.Exp e2;
output DAE.ElementSource source;
end FuncTypeSimpleEquation;
end FuncTypeSimpleEquation;
algorithm
(outEqns,outSimpleEqns,outMvars,outRepl,outExtendLst,outReplc) := matchcontinue (eqns,funcSimpleEquation,vars,knvars,mvars,states,outputs,repl,inExtendLst,replc)
local
Expand All @@ -205,7 +205,7 @@ algorithm
false = BackendVariable.isTopLevelInputOrOutput(cr1,vars,knvars);
failure(_ = BackendDAEUtil.treeGet(outputs, cr1)) "cr1 not output of algorithm";
(extlst,replc_1) = removeSimpleEquations3(inExtendLst,replc,cr1,e2,t);
repl_1 = VarTransform.addReplacement(repl, cr1, e2);
repl_1 = VarTransform.addReplacement(repl, cr1, e2);
mvars_1 = BackendDAEUtil.treeAdd(mvars, cr1, 0);
(eqns_1,seqns_1,mvars_2,repl_2,extlst1,replc_2) = removeSimpleEquations2(eqns, funcSimpleEquation, vars, knvars, mvars_1, states, outputs, repl_1, extlst,replc_1);
then
Expand Down
12 changes: 7 additions & 5 deletions Compiler/CevalScript.mo
Expand Up @@ -4203,18 +4203,20 @@ algorithm
false = RTOpts.debugFlag("nogen");
(cache,false) = Static.isExternalObjectFunction(cache,env,path); //ext objs functions not possible to Ceval.ceval.
pathstr = generateFunctionName(path);
(cache,paths) = cevalGenerateFunctionDAEs(cache, path, env, {});
// (cache,paths) = cevalGenerateFunctionDAEs(cache, path, env, {});
// print(Absyn.pathString(path) +& ": " +& Util.stringDelimitList(Util.listMap(paths, Absyn.pathString), ", ") +& "\n");
paths = Util.listSetDifference(paths, {path});
// paths = Util.listSetDifference(paths, {path});

// The list of functions is not ordered, so we need to filter out the main function...
funcs = Env.getFunctionTree(cache);
// print("Avilable functions: " +& DAEDump.dumpFunctionNamesStr(funcs) +& "\n");
mainFunction = DAEUtil.getNamedFunction(path, funcs);
d = Util.listMap1(paths, DAEUtil.getNamedFunction, funcs);
uniontypePaths = DAEUtil.getUniontypePaths(d, {});
// d = Util.listMap1(paths, DAEUtil.getNamedFunction, funcs);
d = DAEUtil.getFunctionList(funcs);
d = Util.listSetDifference(d, {mainFunction});
uniontypePaths = DAEUtil.getUniontypePaths(Util.if_(RTOpts.debugFlag("cheat"),{},d), {});
(cache,metarecordTypes) = Lookup.lookupMetarecordsRecursive(cache, env, uniontypePaths, {});

SimCode.translateFunctions(pathstr, mainFunction, d, metarecordTypes);
compileModel(pathstr, {}, "", "", "");
then
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Expression.mo
Expand Up @@ -5796,7 +5796,7 @@ public function arrayContainWholeDimension
algorithm
wholedim := matchcontinue(inDim)
local
input list<DAE.Dimension> rest_dims;
list<DAE.Dimension> rest_dims;
case ({}) then false;
case (DAE.DIM_UNKNOWN() :: rest_dims) then true;
case (_ :: rest_dims) then arrayContainZeroDimension(rest_dims);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/SimCode.mo
Expand Up @@ -2611,7 +2611,7 @@ algorithm
simWhenClause := matchcontinue (whenClause, whenEq, whenClauses,helpVarInfo,CurrentIndex)
local
DAE.Exp cond;
input list<BackendDAE.WhenClause> wc;
list<BackendDAE.WhenClause> wc;
list<BackendDAE.WhenOperator> reinits;
list<DAE.ComponentRef> conditionVars;
Integer index_;
Expand Down

0 comments on commit 2ab96fd

Please sign in to comment.