CIRCT 24.0.0git
Loading...
Searching...
No Matches
ReductionCat Class Referenceabstract
Inheritance diagram for ReductionCat:
Collaboration diagram for ReductionCat:

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 1181 of file FIRRTLFolds.cpp.

Constructor & Destructor Documentation

◆ ReductionCat()

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

Definition at line 1183 of file FIRRTLFolds.cpp.

References context.

Referenced by AndRCat::AndRCat(), OrRCat::OrRCat(), and XorRCat::XorRCat().

Member Function Documentation

◆ getIdentityValue()

virtual bool ReductionCat::getIdentityValue ( ) const
pure virtual

Return the unit value for this reduction operation:

Implemented in AndRCat, OrRCat, 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 AndRCat, OrRCat, and XorRCat.

Referenced by matchAndRewrite().

◆ matchAndRewrite()

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

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