calyx
                                
                                 calyx copied to clipboard
                                
                                    calyx copied to clipboard
                            
                            
                            
                        `group2invoke` disables a bunch of passes
The MergeStaticPar and StaticParConv only act upon groups and cannot be run on invoke statements. Since group2invoke turns a lot of simple groups into invoke statements, these passes are less effective. We should probably redesign the pass pipeline so that these passes run after compile-invoke
Once I get LiveRangeAnalysis to Handle Comb Groups, here's what I was thinking (for the ordering of the pre-opt passes). CompileInvoke is currently in compile but I have moved it to pre-opt:
GroupToSeq,
GroupToInvoke, // Creates Dead Groups potentially
ComponentInliner,
CombProp,
CompileRef, //Must run before cell-share.
InferShare,
CellShare, // LiveRangeAnalaysis must handle comb groups
RemoveCombGroups, // Must run before infer-static-timing
InferStaticTiming,
CompileInvoke
MergeStaticPar,
StaticParConv,    // Must be before collapse-control
DeadGroupRemoval, // Since MergeStaticPar and GroupToInvoke potentially create dead groups
CollapseControl,
Does LRA handle comb groups? Also, if we can move somehow move compile-invoke to before remove-comb-groups, we can get rid of the extra cycle cost we have to pay for the invoke-with syntax
- 
LRA doesn't handle comb groups yet, although I can start working on that-- we can discuss more synchronously, but I've been thinking about it like this: for invoke _ with comb groupwe can just set all components used incomb groupas live in the invoke. forif _ with comb grouporwhile _ with comb groupwe can analyze the live set at the comb group itself. In other words, comb groups that go w/ if and while statements should be treated as their own "nodes" in the LiveRangeAnalysis.
- 
I think just moving compile-invoketo be right beforeremove-comb-groupsshould work, unless there's some problem with that that I'm missing. I wasn't thinking about the timing we would save from that.
Currently infer-static-timing benefits from having invokes since it can simply copy the latency of the component to the static time of the invoke. If we do compile-invoke beforehand, we lost thing but it might be a worthwhile trade-off
@calebmkim am I misremember or did you open a PR to fix this during the summer?
So https://github.com/cucapra/calyx/pull/1144 handles this particular issue, in the sense that invokes are compiled into groups so that the MergeStaticPar and StaticParConv passes see groups. However, there may be some work to do in terms of improving the ordering of the passes even more.
Okay, let's close this particular issue in that case