CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::firrtl::IntrinsicLowerings Class Reference

Lowering helper which collects all intrinsic converters. More...

#include <FIRRTLIntrinsics.h>

Collaboration diagram for circt::firrtl::IntrinsicLowerings:

Public Types

using ConversionMapTy

Public Member Functions

 IntrinsicLowerings (MLIRContext *context)
template<typename T, typename... Args>
void add (Args... args)
 Registers a converter to one or more intrinsic names.
FailureOr< size_t > lower (FModuleOp mod, bool allowUnknownIntrinsics=false)
 Lowers all intrinsics in a module. Returns number converted or failure.

Private Member Functions

template<typename T>
std::enable_if_t< std::is_base_of_v< IntrinsicConverter, T > > addConverter (StringRef name)

Private Attributes

MLIRContext * context
 Reference to the MLIR context.
ConversionMapTy conversions
 Mapping from intrinsic names to converters.

Detailed Description

Lowering helper which collects all intrinsic converters.

Definition at line 245 of file FIRRTLIntrinsics.h.

Member Typedef Documentation

◆ ConversionMapTy

Initial value:
llvm::DenseMap<StringAttr, std::unique_ptr<IntrinsicConverter>>

Definition at line 247 of file FIRRTLIntrinsics.h.

Constructor & Destructor Documentation

◆ IntrinsicLowerings()

circt::firrtl::IntrinsicLowerings::IntrinsicLowerings ( MLIRContext * context)
inline

Definition at line 258 of file FIRRTLIntrinsics.h.

References context.

Member Function Documentation

◆ add()

template<typename T, typename... Args>
void circt::firrtl::IntrinsicLowerings::add ( Args... args)
inline

Registers a converter to one or more intrinsic names.

Definition at line 262 of file FIRRTLIntrinsics.h.

References addConverter().

◆ addConverter()

template<typename T>
std::enable_if_t< std::is_base_of_v< IntrinsicConverter, T > > circt::firrtl::IntrinsicLowerings::addConverter ( StringRef name)
inlineprivate

Definition at line 272 of file FIRRTLIntrinsics.h.

References assert(), context, and conversions.

Referenced by add().

◆ lower()

FailureOr< size_t > IntrinsicLowerings::lower ( FModuleOp mod,
bool allowUnknownIntrinsics = false )

Lowers all intrinsics in a module. Returns number converted or failure.

Definition at line 153 of file FIRRTLIntrinsics.cpp.

References circt::firrtl::areTypesEquivalent(), context, conversions, circt::firrtl::emitConnect(), failure(), circt::firrtl::isTypeLarger(), and circt::firrtl::type_dyn_cast().

Member Data Documentation

◆ context

MLIRContext* circt::firrtl::IntrinsicLowerings::context
private

Reference to the MLIR context.

Definition at line 252 of file FIRRTLIntrinsics.h.

Referenced by addConverter(), IntrinsicLowerings(), and lower().

◆ conversions

ConversionMapTy circt::firrtl::IntrinsicLowerings::conversions
private

Mapping from intrinsic names to converters.

Definition at line 255 of file FIRRTLIntrinsics.h.

Referenced by addConverter(), and lower().


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