CIRCT  19.0.0git
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
circt::firrtl::IntrinsicLowerings Class Reference

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

#include <FIRRTLIntrinsics.h>

Collaboration diagram for circt::firrtl::IntrinsicLowerings:
Collaboration graph
[legend]

Public Types

using ConversionMapTy = llvm::DenseMap< StringAttr, std::unique_ptr< IntrinsicConverter > >
 

Public Member Functions

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

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. More...
 
ConversionMapTy conversions
 Mapping from intrinsic names to converters. More...
 

Detailed Description

Lowering helper which collects all intrinsic converters.

Definition at line 219 of file FIRRTLIntrinsics.h.

Member Typedef Documentation

◆ ConversionMapTy

using circt::firrtl::IntrinsicLowerings::ConversionMapTy = llvm::DenseMap<StringAttr, std::unique_ptr<IntrinsicConverter> >

Definition at line 221 of file FIRRTLIntrinsics.h.

Constructor & Destructor Documentation

◆ IntrinsicLowerings()

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

Definition at line 232 of file FIRRTLIntrinsics.h.

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 236 of file FIRRTLIntrinsics.h.

Referenced by circt::firrtl::FIRRTLIntrinsicLoweringDialectInterface::populateIntrinsicLowerings().

◆ 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 246 of file FIRRTLIntrinsics.h.

References assert(), context, conversions, and circt::calyx::direction::get().

◆ 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 147 of file FIRRTLIntrinsics.cpp.

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

Member Data Documentation

◆ context

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

Reference to the MLIR context.

Definition at line 226 of file FIRRTLIntrinsics.h.

Referenced by addConverter(), and lower().

◆ conversions

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

Mapping from intrinsic names to converters.

Definition at line 229 of file FIRRTLIntrinsics.h.

Referenced by addConverter(), and lower().


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