CIRCT 20.0.0git
|
Builds a control schedule by traversing the CFG of the function and associating this with the previously created groups. More...
Private Member Functions | |
LogicalResult | partiallyLowerFuncToComp (FuncOp funcOp, PatternRewriter &rewriter) const override |
LogicalResult | scheduleBasicBlock (PatternRewriter &rewriter, const DenseSet< Block * > &path, mlir::Block *parentCtrlBlock, mlir::Block *block) const |
Sequentially schedules the groups that registered themselves with 'block'. | |
LogicalResult | schedulePath (PatternRewriter &rewriter, const DenseSet< Block * > &path, Location loc, Block *from, Block *to, Block *parentCtrlBlock) const |
Schedules a block by inserting a branch argument assignment block (if any) before recursing into the scheduling of the block innards. | |
LogicalResult | buildCFGControl (DenseSet< Block * > path, PatternRewriter &rewriter, mlir::Block *parentCtrlBlock, mlir::Block *preBlock, mlir::Block *block) const |
void | insertParInitGroups (PatternRewriter &rewriter, Location loc, const SmallVector< calyx::GroupOp > &initGroups) const |
calyx::WhileOp | buildWhileCtrlOp (ScfWhileOp whileOp, SmallVector< calyx::GroupOp > initGroups, PatternRewriter &rewriter) const |
calyx::RepeatOp | buildForCtrlOp (ScfForOp forOp, SmallVector< calyx::GroupOp > const &initGroups, uint64_t bound, PatternRewriter &rewriter) const |
Additional Inherited Members | |
Public Member Functions inherited from circt::calyx::FuncOpPartialLoweringPattern | |
FuncOpPartialLoweringPattern (MLIRContext *context, LogicalResult &resRef, PatternApplicationState &patternState, DenseMap< mlir::func::FuncOp, calyx::ComponentOp > &map, calyx::CalyxLoweringState &state) | |
LogicalResult | partiallyLower (mlir::func::FuncOp funcOp, PatternRewriter &rewriter) const override final |
Entry point to initialize the state of this class and conduct the partial lowering. | |
calyx::ComponentOp | getComponent () const |
Returns the component operation associated with the currently executing partial lowering. | |
template<typename T = ComponentLoweringStateInterface> | |
T & | getState () const |
CalyxLoweringState & | loweringState () const |
Return the calyx lowering state for this pattern. | |
virtual LogicalResult | partiallyLowerFuncToComp (mlir::func::FuncOp funcOp, PatternRewriter &rewriter) const =0 |
Public Member Functions inherited from circt::calyx::PartialLoweringPattern< mlir::func::FuncOp > | |
PartialLoweringPattern (MLIRContext *ctx, LogicalResult &resRef, PatternApplicationState &patternState) | |
LogicalResult | matchAndRewrite (mlir::func::FuncOp op, PatternRewriter &rewriter) const override |
Protected Attributes inherited from circt::calyx::FuncOpPartialLoweringPattern | |
DenseMap< mlir::func::FuncOp, calyx::ComponentOp > & | functionMapping |
Builds a control schedule by traversing the CFG of the function and associating this with the previously created groups.
For simplicity, the generated control flow is expanded for all possible paths in the input DAG. This elaborated control flow is later reduced in the runControlFlowSimplification passes.
Definition at line 2018 of file SCFToCalyx.cpp.
|
inlineprivate |
TODO(mortbopet): we could choose to support ie. std.switch, but it would probably be easier to just require it to be lowered beforehand.
Wrap each branch inside an if/else.
Schedule sequentially within the current parent control block.
Definition at line 2271 of file SCFToCalyx.cpp.
References assert(), scheduleBasicBlock(), and schedulePath().
Referenced by partiallyLowerFuncToComp(), scheduleBasicBlock(), and schedulePath().
|
inlineprivate |
Definition at line 2364 of file SCFToCalyx.cpp.
References circt::calyx::RepeatOpInterface< T >::getLoc(), and insertParInitGroups().
Referenced by scheduleBasicBlock().
|
inlineprivate |
Insert while iter arg initialization group(s). Emit a parallel group to assign one or more registers all at once.
Insert the while op itself.
Definition at line 2347 of file SCFToCalyx.cpp.
References circt::scftocalyx::ScfWhileOp::getConditionValue(), circt::calyx::WhileOpInterface< T >::getLoc(), and insertParInitGroups().
Referenced by scheduleBasicBlock().
|
inlineprivate |
Definition at line 2338 of file SCFToCalyx.cpp.
Referenced by buildForCtrlOp(), and buildWhileCtrlOp().
|
inlineoverrideprivate |
Definition at line 2022 of file SCFToCalyx.cpp.
References buildCFGControl(), getBodyBlock(), and circt::calyx::FuncOpPartialLoweringPattern::getComponent().
|
inlineprivate |
Sequentially schedules the groups that registered themselves with 'block'.
Only schedule the 'after' block. The 'before' block is implicitly scheduled when evaluating the while condition.
Definition at line 2036 of file SCFToCalyx.cpp.
References buildCFGControl(), buildForCtrlOp(), buildWhileCtrlOp(), circt::calyx::CalyxLoweringState::getState(), circt::calyx::FuncOpPartialLoweringPattern::loweringState(), and scheduleBasicBlock().
Referenced by buildCFGControl(), and scheduleBasicBlock().
|
inlineprivate |
Schedules a block by inserting a branch argument assignment block (if any) before recursing into the scheduling of the block innards.
Blocks 'from' and 'to' refer to blocks in the source program. parentCtrlBlock refers to the control block wherein control operations are to be inserted.
Schedule any registered block arguments to be executed before the body of the branch.
Definition at line 2255 of file SCFToCalyx.cpp.
References buildCFGControl().
Referenced by buildCFGControl().