CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::scftocalyx::BuildWhileGroups Class Reference

In BuildWhileGroups, a register is created for each iteration argumenet of the while op. More...

Inheritance diagram for circt::scftocalyx::BuildWhileGroups:
Collaboration diagram for circt::scftocalyx::BuildWhileGroups:

Private Member Functions

LogicalResult partiallyLowerFuncToComp (FuncOp funcOp, PatternRewriter &rewriter) const override

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

Detailed Description

In BuildWhileGroups, a register is created for each iteration argumenet of the while op.

These registers are then written to on the while op terminating yield operation alongside before executing the whileOp in the schedule, to set the initial values of the argument registers.

Definition at line 2013 of file SCFToCalyx.cpp.

Member Function Documentation

◆ partiallyLowerFuncToComp()

LogicalResult circt::scftocalyx::BuildWhileGroups::partiallyLowerFuncToComp ( FuncOp funcOp,
PatternRewriter & rewriter ) const
inlineoverrideprivate

Check for do-while loops. TODO(mortbopet) can we support these? for now, do not support loops where iterargs are changed in the 'before' region. scf.WhileOp also has support for different types of iter_args and return args which we also do not support; iter_args and while return values are placed in the same registers.

Create iteration argument registers. The iteration argument registers will be referenced:

  • In the "before" part of the while loop, calculating the conditional,
  • In the "after" part of the while loop,
  • Outside the while loop, rewriting the while loop return values.

Also replace uses in the "before" region of the while loop

Create iter args initial value assignment group(s), one per register.

Definition at line 2017 of file SCFToCalyx.cpp.

References circt::scftocalyx::ScfWhileOp::getBodyArgs(), circt::calyx::FuncOpPartialLoweringPattern::getComponent(), circt::scftocalyx::ScfWhileOp::getConditionBlock(), circt::calyx::WhileOpInterface< T >::getOperation(), circt::calyx::FuncOpPartialLoweringPattern::getState(), circt::calyx::CalyxLoweringState::irName(), circt::calyx::FuncOpPartialLoweringPattern::loweringState(), and success().


The documentation for this class was generated from the following file: