Skip to content

Commit

Permalink
Оптимизация MakeDriveTree/GrowDriveTree (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazdaywik committed Jun 27, 2021
1 parent 09999a7 commit ca5f0d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
17 changes: 7 additions & 10 deletions src/compiler/OptTree-Drive-Expr.ref
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ MakeDriveTree {
: s.CntNodes^ s.TreeDepth^
= <CheckExprsStopRelation e.canoninzedExprs>
: {
True s.Cnt
= Generalize s.Cnt;
True s.Cnt = Generalize t.OptInfo s.Cnt;

s._ s._, <MaxCntNodes> : s.CntNodes
= ((s.CntNodes) t.OptInfo (/* нет функций */))
Expand Down Expand Up @@ -162,27 +161,25 @@ GrowDriveTree-Call {
= ((s.CntNodes) t.OptInfo (e.NewFunctionsAccum e.NewFunctions))
(e.Contractions (e.DrivenRight) (e.Branches));

Generalize s.Cnt
= (Generalize s.Cnt);
Generalize t.OptInfo^ s.Cnt = (Generalize t.OptInfo s.Cnt);
};

(Generalize s.Cnt) (e.Contractions (e.DrivenRight))
= (Generalize s.Cnt);
(Generalize t.OptInfo s.Cnt) (e.Contractions (e.DrivenRight))
= (Generalize t.OptInfo s.Cnt);
}
((s.CntNodes) ((e.OptFuncNames) e.OptFuncs) (e.NewFunctions))
e.Branches
>
: {
(Generalize 1) e._DeletedTree
= ((e.OptFuncNames) e.OptFuncs) : t.OptInfo
(Generalize t.OptInfo 1) e._DeletedTree
= <GrowDriveTree
(s.CntNodes) (e.UsedVars) (e.WholeVars) t.OptInfo
<RestoreDrivenCall t.Call e.Expr>
(s.TreeDepth e.canoninzedExprs)
>;

(Generalize s.Cnt) e._DeletedTree
= Generalize <Sub s.Cnt 1>;
(Generalize t.OptInfo s.Cnt) e._DeletedTree
= Generalize t.OptInfo <Sub s.Cnt 1>;

e.Tree = e.Tree;
};
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/[email protected]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
print-statistics = true
enable-profiler = false
enable-profiler = true
dump-file = __srefc-core.dump.txt

0 comments on commit ca5f0d1

Please sign in to comment.