Skip to content

Commit bda80c0

Browse files
CynyuSparthsarkar17sampsyo
authored
Medium fsm pass (#2528)
Implementing the mechanism pass based off of annotations of acyclic, inlining, unrolling, and offloading. Currently only works for single static enables, and static repeats with the @unroll operator! More testing in progress! --------- Co-authored-by: Parth Sarkar <[email protected]> Co-authored-by: Adrian Sampson <[email protected]>
1 parent bbeaa14 commit bda80c0

18 files changed

+892
-2
lines changed

calyx/opt/src/default_passes.rs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ use crate::passes::{
1414
};
1515
use crate::passes_experimental::{
1616
CompileSync, CompileSyncWithoutSyncReg, DiscoverExternal, ExternalToRef,
17-
FSMAnnotator, HoleInliner, Metadata, ParToSeq, RegisterUnsharing,
17+
FSMAnnotator, FSMBuilder, HoleInliner, Metadata, ParToSeq,
18+
RegisterUnsharing,
1819
};
1920
use crate::traversal::Named;
2021
use crate::{pass_manager::PassManager, register_alias};
@@ -58,6 +59,7 @@ impl PassManager {
5859
pm.register_pass::<CompileSyncWithoutSyncReg>()?;
5960
pm.register_pass::<AddGuard>()?;
6061
pm.register_pass::<FSMAnnotator>()?;
62+
pm.register_pass::<FSMBuilder>()?;
6163

6264
// Lowering passes
6365
pm.register_pass::<GoInsertion>()?;
@@ -147,6 +149,35 @@ impl PassManager {
147149
]
148150
);
149151

152+
register_alias!(
153+
pm,
154+
"med-fsm",
155+
[
156+
DataPathInfer,
157+
CollapseControl,
158+
CompileSyncWithoutSyncReg,
159+
GroupToSeq, // FIXME: may make programs *slower*
160+
DeadAssignmentRemoval,
161+
GroupToInvoke,
162+
ComponentInliner,
163+
CombProp,
164+
// DeadCellRemoval,
165+
CellShare,
166+
SimplifyWithControl,
167+
CompileInvoke,
168+
StaticInference,
169+
StaticPromotion,
170+
DeadGroupRemoval,
171+
CollapseControl,
172+
FSMAnnotator,
173+
FSMBuilder,
174+
DeadGroupRemoval,
175+
MergeAssign,
176+
CompileRepeat,
177+
TopDownCompileControl,
178+
]
179+
);
180+
150181
register_alias!(
151182
pm,
152183
"compile-fsm",
@@ -160,6 +191,7 @@ impl PassManager {
160191
ComponentInliner,
161192
CombProp,
162193
DeadCellRemoval,
194+
CellShare,
163195
SimplifyWithControl,
164196
CompileInvoke,
165197
StaticInference,

0 commit comments

Comments
 (0)