22 assert(
bb &&
"Trying to 'get' a mapped value without any value set. No "
23 "BackedgeBuilder was provided, so cannot provide any mapped "
27 mapping[from] =
bb->
get(typeTransformer(from.getType()));
29 auto operandMapping =
mapping[from];
31 if (
auto *v = std::get_if<Value>(&operandMapping))
34 mappedOperand = std::get<Backedge>(operandMapping);
39 TypeTransformer typeTransformer) {
40 llvm::SmallVector<Value> to;
42 to.push_back(
get(f, typeTransformer));
49 if (
auto *backedge = std::get_if<Backedge>(&it->second))
50 backedge->setValue(to);
52 assert(
false &&
"'from' was already mapped to a final value!");
59 assert(from.size() == to.size() &&
60 "Expected # of 'from' values and # of 'to' values to be identical.");
61 for (
auto [f, t] :
llvm::zip(from, to))
assert(baseType &&"element must be base type")
Backedge get(mlir::Type resultType, mlir::LocationAttr optionalLoc={})
Create a typed backedge.
llvm::DenseMap< mlir::Value, std::variant< mlir::Value, Backedge > > mapping
void set(mlir::Value from, mlir::Value to, bool replace=false)
mlir::Value get(mlir::Value from, TypeTransformer typeTransformer=ValueMapper::identity)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.