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

The ValueMapper class facilitates the definition and connection of SSA def-use chains between two location - a 'from' location (defining use-def chains) and a 'to' location (where new operations are created based on the 'from' location). More...

#include <ValueMapper.h>

Collaboration diagram for circt::ValueMapper:

Public Types

using TypeTransformer = llvm::function_ref<mlir::Type(mlir::Type)>

Public Member Functions

 ValueMapper (BackedgeBuilder *bb=nullptr)
mlir::Value get (mlir::Value from, TypeTransformer typeTransformer=ValueMapper::identity)
llvm::SmallVector< mlir::Value > get (mlir::ValueRange from, TypeTransformer typeTransformer=ValueMapper::identity)
void set (mlir::Value from, mlir::Value to, bool replace=false)
void set (mlir::ValueRange from, mlir::ValueRange to, bool replace=false)

Static Public Member Functions

static mlir::Type identity (mlir::Type t)

Private Attributes

BackedgeBuilder * bb = nullptr
llvm::DenseMap< mlir::Value, std::variant< mlir::Value, Backedge > > mapping

Detailed Description

The ValueMapper class facilitates the definition and connection of SSA def-use chains between two location - a 'from' location (defining use-def chains) and a 'to' location (where new operations are created based on the 'from' location).

ยด

Definition at line 35 of file ValueMapper.h.

Member Typedef Documentation

◆ TypeTransformer

using circt::ValueMapper::TypeTransformer = llvm::function_ref<mlir::Type(mlir::Type)>

Definition at line 37 of file ValueMapper.h.

Constructor & Destructor Documentation

◆ ValueMapper()

circt::ValueMapper::ValueMapper ( BackedgeBuilder * bb = nullptr)
inlineexplicit

Definition at line 39 of file ValueMapper.h.

References bb.

Member Function Documentation

◆ get() [1/2]

mlir::Value circt::ValueMapper::get ( mlir::Value from,
TypeTransformer typeTransformer = ValueMapper::identity )

References identity().

Referenced by circt::ssp::saveProblem().

◆ get() [2/2]

llvm::SmallVector< mlir::Value > circt::ValueMapper::get ( mlir::ValueRange from,
TypeTransformer typeTransformer = ValueMapper::identity )

References identity().

◆ identity()

mlir::Type circt::ValueMapper::identity ( mlir::Type t)
inlinestatic

Definition at line 38 of file ValueMapper.h.

Referenced by get(), and get().

◆ set() [1/2]

void circt::ValueMapper::set ( mlir::Value from,
mlir::Value to,
bool replace = false )

Referenced by circt::ssp::saveProblem().

◆ set() [2/2]

void circt::ValueMapper::set ( mlir::ValueRange from,
mlir::ValueRange to,
bool replace = false )

Member Data Documentation

◆ bb

BackedgeBuilder* circt::ValueMapper::bb = nullptr
private

Definition at line 57 of file ValueMapper.h.

Referenced by ValueMapper().

◆ mapping

llvm::DenseMap<mlir::Value, std::variant<mlir::Value, Backedge> > circt::ValueMapper::mapping
private

Definition at line 58 of file ValueMapper.h.


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