Loading [MathJax]/extensions/tex2jax.js
CIRCT 22.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ReductionCat Class Referenceabstract
Inheritance diagram for ReductionCat:
Inheritance graph
[legend]
Collaboration diagram for ReductionCat:
Collaboration graph
[legend]

Public Member Functions

 ReductionCat (MLIRContext *context, llvm::StringLiteral opName)
 
virtual bool handleConstant (mlir::PatternRewriter &rewriter, Operation *op, ConstantOp constantOp, SmallVectorImpl< Value > &remaining) const =0
 Handle a constant operand in the cat operation.
 
virtual bool getIdentityValue () const =0
 Return the unit value for this reduction operation:
 
LogicalResult matchAndRewrite (Operation *op, mlir::PatternRewriter &rewriter) const override
 

Detailed Description

Definition at line 1115 of file FIRRTLFolds.cpp.

Constructor & Destructor Documentation

◆ ReductionCat()

ReductionCat::ReductionCat ( MLIRContext *  context,
llvm::StringLiteral  opName 
)
inline

Definition at line 1117 of file FIRRTLFolds.cpp.

Member Function Documentation

◆ getIdentityValue()

virtual bool ReductionCat::getIdentityValue ( ) const
pure virtual

Return the unit value for this reduction operation:

Implemented in OrRCat, AndRCat, and XorRCat.

Referenced by matchAndRewrite().

◆ handleConstant()

virtual bool ReductionCat::handleConstant ( mlir::PatternRewriter &  rewriter,
Operation *  op,
ConstantOp  constantOp,
SmallVectorImpl< Value > &  remaining 
) const
pure virtual

Handle a constant operand in the cat operation.

Returns true if the entire reduction can be replaced with a constant. May add non-zero constants to the remaining operands list.

Implemented in OrRCat, AndRCat, and XorRCat.

Referenced by matchAndRewrite().

◆ matchAndRewrite()

LogicalResult ReductionCat::matchAndRewrite ( Operation *  op,
mlir::PatternRewriter &  rewriter 
) const
inlineoverride

Definition at line 1131 of file FIRRTLFolds.cpp.

References getIdentityValue(), and handleConstant().


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