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

Member Typedef Documentation

◆ ConversionMapTy

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

Definition at line 220 of file FIRRTLIntrinsics.h.

Constructor & Destructor Documentation

◆ IntrinsicLowerings()

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

Definition at line 231 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 235 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 245 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 135 of file FIRRTLIntrinsics.cpp.

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

Member Data Documentation

◆ context

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

Reference to the MLIR context.

Definition at line 225 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 228 of file FIRRTLIntrinsics.h.

Referenced by addConverter(), and lower().


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