CIRCT  19.0.0git
Public Member Functions | Protected Attributes | Private Attributes | List of all members
circt::calyx::FuncOpPartialLoweringPattern Class Referenceabstract

FuncOpPartialLoweringPatterns are patterns which intend to match on FuncOps and then perform their own walking of the IR. More...

#include <CalyxLoweringUtils.h>

Inheritance diagram for circt::calyx::FuncOpPartialLoweringPattern:
Inheritance graph
[legend]
Collaboration diagram for circt::calyx::FuncOpPartialLoweringPattern:
Collaboration graph
[legend]

Public Member Functions

 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. More...
 
calyx::ComponentOp getComponent () const
 Returns the component operation associated with the currently executing partial lowering. More...
 
template<typename T = ComponentLoweringStateInterface>
T & getState () const
 
CalyxLoweringStateloweringState () const
 Return the calyx lowering state for this pattern. More...
 
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

DenseMap< mlir::func::FuncOp, calyx::ComponentOp > & functionMapping
 

Private Attributes

ComponentOp componentOp
 
ComponentLoweringStateInterfacecomponentLoweringState = nullptr
 
CalyxLoweringStatecalyxLoweringState
 

Detailed Description

FuncOpPartialLoweringPatterns are patterns which intend to match on FuncOps and then perform their own walking of the IR.

Definition at line 582 of file CalyxLoweringUtils.h.

Constructor & Destructor Documentation

◆ FuncOpPartialLoweringPattern()

circt::calyx::FuncOpPartialLoweringPattern::FuncOpPartialLoweringPattern ( MLIRContext *  context,
LogicalResult &  resRef,
PatternApplicationState patternState,
DenseMap< mlir::func::FuncOp, calyx::ComponentOp > &  map,
calyx::CalyxLoweringState state 
)

Definition at line 470 of file CalyxLoweringUtils.cpp.

Member Function Documentation

◆ getComponent()

calyx::ComponentOp circt::calyx::FuncOpPartialLoweringPattern::getComponent ( ) const

Returns the component operation associated with the currently executing partial lowering.

Definition at line 493 of file CalyxLoweringUtils.cpp.

References assert(), and componentOp.

Referenced by circt::calyx::BuildReturnRegs::partiallyLowerFuncToComp(), and circt::calyx::BuildCallInstance::partiallyLowerFuncToComp().

◆ getState()

template<typename T = ComponentLoweringStateInterface>
T& circt::calyx::FuncOpPartialLoweringPattern::getState ( ) const
inline

◆ loweringState()

CalyxLoweringState & circt::calyx::FuncOpPartialLoweringPattern::loweringState ( ) const

Return the calyx lowering state for this pattern.

Definition at line 499 of file CalyxLoweringUtils.cpp.

References calyxLoweringState.

◆ partiallyLower()

LogicalResult circt::calyx::FuncOpPartialLoweringPattern::partiallyLower ( mlir::func::FuncOp  funcOp,
PatternRewriter &  rewriter 
) const
finaloverridevirtual

Entry point to initialize the state of this class and conduct the partial lowering.

Implements circt::calyx::PartialLoweringPattern< mlir::func::FuncOp >.

Definition at line 479 of file CalyxLoweringUtils.cpp.

References calyxLoweringState, componentLoweringState, componentOp, functionMapping, circt::calyx::CalyxLoweringState::getState(), and partiallyLowerFuncToComp().

◆ partiallyLowerFuncToComp()

virtual LogicalResult circt::calyx::FuncOpPartialLoweringPattern::partiallyLowerFuncToComp ( mlir::func::FuncOp  funcOp,
PatternRewriter &  rewriter 
) const
pure virtual

Member Data Documentation

◆ calyxLoweringState

CalyxLoweringState& circt::calyx::FuncOpPartialLoweringPattern::calyxLoweringState
private

Definition at line 637 of file CalyxLoweringUtils.h.

Referenced by loweringState(), and partiallyLower().

◆ componentLoweringState

ComponentLoweringStateInterface* circt::calyx::FuncOpPartialLoweringPattern::componentLoweringState = nullptr
mutableprivate

Definition at line 636 of file CalyxLoweringUtils.h.

Referenced by getState(), and partiallyLower().

◆ componentOp

ComponentOp circt::calyx::FuncOpPartialLoweringPattern::componentOp
mutableprivate

◆ functionMapping

DenseMap<mlir::func::FuncOp, calyx::ComponentOp>& circt::calyx::FuncOpPartialLoweringPattern::functionMapping
protected

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