Skip to content

Commit

Permalink
Make cse variables parameters that are added to globalKnownVars (#8551)
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Feb 16, 2022
1 parent 0897872 commit b1522d8
Show file tree
Hide file tree
Showing 16 changed files with 650 additions and 167 deletions.
7 changes: 7 additions & 0 deletions OMCompiler/Compiler/BackEnd/BackendVariable.mo
Expand Up @@ -1248,6 +1248,13 @@ algorithm
end match;
end isParam;

public function makeParam
"Change variable to parameter"
input output BackendDAE.Var var;
algorithm
var.varKind := BackendDAE.PARAM();
end makeParam;

public function isParamOrConstant
"Return true if variable is parameter or constant"
input BackendDAE.Var invar;
Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/BackEnd/CommonSubExpression.mo
Expand Up @@ -545,7 +545,7 @@ algorithm

// Save the rhs (call) as bind expression and set fixed=true
var := BackendVariable.setBindExp(var, SOME(call));
var := BackendVariable.setVarFixed(var, true);
var := BackendVariable.makeParam(var);

// If it is a tuple or a record (or record within tuple)
if intGt(listLength(varList), 1) or Expression.isTuple(cse) then
Expand Down

0 comments on commit b1522d8

Please sign in to comment.