16 #ifndef CIRCT_SUPPORT_VALUEMAPPER_H
17 #define CIRCT_SUPPORT_VALUEMAPPER_H
20 #include "mlir/IR/Location.h"
21 #include "mlir/IR/OperationSupport.h"
22 #include "mlir/IR/Value.h"
23 #include "llvm/ADT/DenseMap.h"
24 #include "llvm/ADT/SmallVector.h"
38 static mlir::Type
identity(mlir::Type t) {
return t; };
44 mlir::Value
get(mlir::Value from,
46 llvm::SmallVector<mlir::Value>
47 get(mlir::ValueRange from,
53 void set(mlir::Value from, mlir::Value to,
bool replace =
false);
54 void set(mlir::ValueRange from, mlir::ValueRange to,
bool replace =
false);
58 llvm::DenseMap<mlir::Value, std::variant<mlir::Value, Backedge>>
mapping;
Instantiate one of these and use it to build typed backedges.
The ValueMapper class facilitates the definition and connection of SSA def-use chains between two loc...
llvm::DenseMap< mlir::Value, std::variant< mlir::Value, Backedge > > mapping
void set(mlir::Value from, mlir::Value to, bool replace=false)
llvm::function_ref< mlir::Type(mlir::Type)> TypeTransformer
static mlir::Type identity(mlir::Type t)
void set(mlir::ValueRange from, mlir::ValueRange to, bool replace=false)
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)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.