CIRCT 24.0.0git
Loading...
Searching...
No Matches
Evaluator.h
Go to the documentation of this file.
1//===- Evaluator.h - Object Model dialect evaluator -----------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains the Object Model dialect declaration.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CIRCT_DIALECT_OM_EVALUATOR_EVALUATOR_H
14#define CIRCT_DIALECT_OM_EVALUATOR_EVALUATOR_H
15
17#include "circt/Support/LLVM.h"
18#include "mlir/IR/BuiltinOps.h"
19#include "mlir/IR/Diagnostics.h"
20#include "mlir/IR/Location.h"
21#include "mlir/IR/MLIRContext.h"
22#include "mlir/IR/SymbolTable.h"
23#include "mlir/Support/LogicalResult.h"
24#include "llvm/ADT/SmallString.h"
25#include "llvm/Support/Debug.h"
26
27#include <utility>
28
29namespace circt {
30namespace om {
31
32namespace evaluator {
33class EvaluatorValue;
34
35/// A value of an object in memory. It is either a composite Object, or a
36/// primitive Attribute. Further refinement is expected.
37using EvaluatorValuePtr = std::shared_ptr<EvaluatorValue>;
38
39/// The fields of a composite Object, currently represented as a map. Further
40/// refinement is expected.
42
43/// Base class for evaluator runtime values.
44/// Enables the shared_from_this functionality so Evaluator Value pointers can
45/// be passed through the CAPI and unwrapped back into C++ smart pointers with
46/// the appropriate reference count.
47class EvaluatorValue : public std::enable_shared_from_this<EvaluatorValue> {
48public:
49 // Implement LLVM RTTI.
50 enum class Kind { Attr, Object, List, Option, BasePath, Path };
51 EvaluatorValue(MLIRContext *ctx, Kind kind, Location loc)
52 : kind(kind), ctx(ctx), loc(loc) {}
53 Kind getKind() const { return kind; }
54 MLIRContext *getContext() const { return ctx; }
55
56 // Return true the value is fully evaluated.
57 // Unknown values are considered fully evaluated.
58 bool isFullyEvaluated() const { return fullyEvaluated; }
60 assert(!fullyEvaluated && "should not mark twice");
61 fullyEvaluated = true;
62 }
63
64 /// Return true if the value itself is unknown. This does not recursively
65 /// inspect object fields or container payloads.
66 bool isUnknown() const { return unknown; }
67
68 /// Mark this value as unknown.
69 /// This also marks the value as fully evaluated if it isn't already, since
70 /// unknown values are considered fully evaluated. This maintains the
71 /// invariant that unknown implies fullyEvaluated.
72 void markUnknown() {
73 unknown = true;
74 if (!fullyEvaluated)
76 }
77
78 /// Return the associated MLIR context.
79 MLIRContext *getContext() { return ctx; }
80
81 // Return a MLIR type which the value represents.
82 Type getType() const;
83
84 // Return the Location associated with the Value.
85 Location getLoc() const { return loc; }
86 // Set the Location associated with the Value.
87 void setLoc(Location l) { loc = l; }
88 // Set the Location, if it is unknown.
89 void setLocIfUnknown(Location l) {
90 if (isa<UnknownLoc>(loc))
91 loc = l;
92 }
93
94private:
95 const Kind kind;
96 MLIRContext *ctx;
97 Location loc;
98 bool fullyEvaluated = false;
99 bool unknown = false;
100};
101
102/// Values which can be directly representable by MLIR attributes.
104public:
105 Attribute getAttr() const { return attr; }
106 template <typename AttrTy>
107 AttrTy getAs() const {
108 return dyn_cast<AttrTy>(attr);
109 }
110 static bool classof(const EvaluatorValue *e) {
111 return e->getKind() == Kind::Attr;
112 }
113
114 // Set Attribute for partially evaluated case.
115 LogicalResult setAttr(Attribute attr);
116
117 Type getType() const { return type; }
118
119 // Factory methods that create AttributeValue objects
120 static std::shared_ptr<EvaluatorValue> get(Attribute attr,
121 LocationAttr loc = {});
122 static std::shared_ptr<EvaluatorValue> get(Type type, LocationAttr loc = {});
123
124private:
125 // Make AttributeValue constructible only by the factory methods
126 struct PrivateTag {};
127
128 // Constructor that requires a PrivateTag
129 AttributeValue(PrivateTag, Attribute attr, Location loc)
131 type(cast<TypedAttr>(attr).getType()) {
133 }
134
135 // Constructor for partially evaluated AttributeValue
138
139 Attribute attr = {};
140 Type type;
141
142 // Friend declaration for the factory methods
143 friend std::shared_ptr<EvaluatorValue> get(Attribute attr, LocationAttr loc);
144 friend std::shared_ptr<EvaluatorValue> get(Type type, LocationAttr loc);
145};
146
147/// A List which contains variadic length of elements with the same type.
148class ListValue : public EvaluatorValue {
149public:
150 ListValue(om::ListType type, SmallVector<EvaluatorValuePtr> elements,
151 Location loc)
153 elements(std::move(elements)) {
155 }
156
157 void setElements(SmallVector<EvaluatorValuePtr> newElements) {
158 elements = std::move(newElements);
160 }
161
162 // Partially evaluated value.
163 ListValue(om::ListType type, Location loc)
164 : EvaluatorValue(type.getContext(), Kind::List, loc), type(type) {}
165
166 const auto &getElements() const { return elements; }
167
168 /// Return the type of the value, which is a ListType.
169 om::ListType getListType() const { return type; }
170
171 /// Implement LLVM RTTI.
172 static bool classof(const EvaluatorValue *e) {
173 return e->getKind() == Kind::List;
174 }
175
176private:
177 om::ListType type;
178 SmallVector<EvaluatorValuePtr> elements;
179};
180
181/// An option whose payload may be unevaluated to support forward references
182/// and cycles. Options imported into scratch IR with unknown payloads are
183/// canonicalized to unknown options during elaboration.
185public:
186 // Placeholder until we know whether the option is empty or has a value.
187 OptionValue(om::OptionType type, Location loc)
189
190 // A null payload means an empty option.
191 OptionValue(om::OptionType type, EvaluatorValuePtr value, Location loc)
193 value(std::move(value)) {
195 }
196
198 assert(!isFullyEvaluated() && "option is already evaluated");
199 value = std::move(newValue);
201 }
202
203 om::OptionType getOptionType() const { return type; }
204
205 bool hasValue() const {
207 "cannot query an unevaluated or unknown option");
208 return bool(value);
209 }
210
212 assert(hasValue() && "option is empty");
213 return value;
214 }
215
216 static bool classof(const EvaluatorValue *e) {
217 return e->getKind() == Kind::Option;
218 }
219
220private:
221 om::OptionType type;
223};
224
225/// A composite Object, which has a type and fields.
227public:
228 ObjectValue(om::ClassLike cls, ObjectFields fields, Location loc)
230 fields(std::move(fields)) {
232 }
233
234 // Partially evaluated value.
235 ObjectValue(om::ClassLike cls, Location loc)
237
238 om::ClassLike getClassOp() const { return cls; }
239 const auto &getFields() const { return fields; }
240
242 fields = std::move(newFields);
244 }
245
246 /// Return the type of the value, which is a ClassType.
247 om::ClassType getObjectType() const {
248 auto clsNonConst = const_cast<om::ClassLike &>(cls);
249 return ClassType::get(clsNonConst.getContext(),
250 FlatSymbolRefAttr::get(clsNonConst.getSymNameAttr()));
251 }
252
253 Type getType() const { return getObjectType(); }
254
255 /// Implement LLVM RTTI.
256 static bool classof(const EvaluatorValue *e) {
257 return e->getKind() == Kind::Object;
258 }
259
260 /// Get a field of the Object by name.
261 FailureOr<EvaluatorValuePtr> getField(StringAttr field);
262 FailureOr<EvaluatorValuePtr> getField(StringRef field) {
263 return getField(StringAttr::get(getContext(), field));
264 }
265
266 /// Get all the field names of the Object.
267 ArrayAttr getFieldNames();
268
269private:
270 om::ClassLike cls;
272};
273
274/// A Basepath value.
276public:
277 BasePathValue(MLIRContext *context);
278
279 /// Create a path value representing a basepath.
280 BasePathValue(om::PathAttr path, Location loc);
281
282 om::PathAttr getPath() const;
283
284 /// Set the basepath which this path is relative to.
285 void setBasepath(const BasePathValue &basepath);
286
287 /// Implement LLVM RTTI.
288 static bool classof(const EvaluatorValue *e) {
289 return e->getKind() == Kind::BasePath;
290 }
291
292private:
293 om::PathAttr path;
294};
295
296/// A Path value.
297class PathValue : public EvaluatorValue {
298public:
299 /// Create a path value representing a regular path.
300 PathValue(om::TargetKindAttr targetKind, om::PathAttr path, StringAttr module,
301 StringAttr ref, StringAttr field, Location loc);
302
303 static PathValue getEmptyPath(Location loc);
304
305 om::TargetKindAttr getTargetKind() const { return targetKind; }
306
307 om::PathAttr getPath() const { return path; }
308
309 StringAttr getModule() const { return module; }
310
311 StringAttr getRef() const { return ref; }
312
313 StringAttr getField() const { return field; }
314
315 StringAttr getAsString() const;
316
317 void setBasepath(const BasePathValue &basepath);
318
319 /// Implement LLVM RTTI.
320 static bool classof(const EvaluatorValue *e) {
321 return e->getKind() == Kind::Path;
322 }
323
324private:
325 om::TargetKindAttr targetKind;
326 om::PathAttr path;
327 StringAttr module;
328 StringAttr ref;
329 StringAttr field;
330};
331
332} // namespace evaluator
333
336
337SmallVector<EvaluatorValuePtr>
339 ArrayRef<Attribute> attributes);
340
341/// An Evaluator, which is constructed with an IR module and can instantiate
342/// Objects. Further refinement is expected.
344public:
345 /// Construct an Evaluator with an IR module.
346 Evaluator(ModuleOp mod);
347
348 /// Instantiate an Object with its class name and actual parameters.
349 FailureOr<evaluator::EvaluatorValuePtr>
350 instantiate(StringAttr className, ArrayRef<EvaluatorValuePtr> actualParams);
351
352 /// Get the Module this Evaluator is built from.
353 mlir::ModuleOp getModule();
354
355 FailureOr<evaluator::EvaluatorValuePtr>
356 getPartiallyEvaluatedValue(Type type, Location loc);
357
358 using ActualParameters = ArrayRef<EvaluatorValuePtr>;
359
360private:
361 FailureOr<evaluator::EvaluatorValuePtr>
362 instantiateImpl(StringAttr className,
363 ArrayRef<EvaluatorValuePtr> actualParams);
364
365 FailureOr<EvaluatorValuePtr>
366 getOrCreateValue(Value value, ActualParameters actualParams, Location loc);
367 /// Evaluate a Value in a Class body according to the small expression grammar
368 /// described in the rationale document. The actual parameters are the values
369 /// supplied at the current instantiation of the Class being evaluated.
370 FailureOr<EvaluatorValuePtr>
371 evaluateValue(Value value, ActualParameters actualParams, Location loc);
372
373 /// Evaluator dispatch functions for the small expression grammar.
374 FailureOr<EvaluatorValuePtr> evaluateParameter(BlockArgument formalParam,
375 ActualParameters actualParams,
376 Location loc);
377
378 FailureOr<EvaluatorValuePtr>
379 evaluateConstant(ConstantOp op, ActualParameters actualParams, Location loc);
380
381 /// Instantiate an Object with its class name and actual parameters.
382 FailureOr<EvaluatorValuePtr>
383 evaluateObjectInstance(StringAttr className, ActualParameters actualParams,
384 Location loc);
385 FailureOr<EvaluatorValuePtr>
386 evaluateElaboratedObject(ElaboratedObjectOp op, ActualParameters actualParams,
387 Location loc);
388 FailureOr<EvaluatorValuePtr>
389 evaluateCollectionCreate(Operation *op, ActualParameters actualParams,
390 Location loc);
391 FailureOr<EvaluatorValuePtr> evaluateListConcat(ListConcatOp op,
392 ActualParameters actualParams,
393 Location loc);
394 FailureOr<EvaluatorValuePtr>
395 evaluateOptionCreate(OptionCreateOp op, ActualParameters actualParams,
396 Location loc);
397 FailureOr<evaluator::EvaluatorValuePtr>
398 evaluateBasePathCreate(FrozenBasePathCreateOp op,
399 ActualParameters actualParams, Location loc);
400 FailureOr<evaluator::EvaluatorValuePtr>
401 evaluatePathCreate(FrozenPathCreateOp op, ActualParameters actualParams,
402 Location loc);
403 FailureOr<evaluator::EvaluatorValuePtr>
404 evaluateEmptyPath(FrozenEmptyPathOp op, ActualParameters actualParams,
405 Location loc);
406 FailureOr<evaluator::EvaluatorValuePtr>
407 evaluateUnknownValue(UnknownValueOp op, Location loc);
408
409 FailureOr<evaluator::EvaluatorValuePtr> createUnknownValue(Type type,
410 Location loc);
411
412 /// The symbol table for the IR module the Evaluator was constructed with.
413 /// Used to look up class definitions.
414 SymbolTable symbolTable;
415
416 /// Evaluator value storage for the current instantiation.
417 DenseMap<Value, std::shared_ptr<evaluator::EvaluatorValue>> objects;
418
419#ifndef NDEBUG
420 /// Current nesting depth for debug output indentation.
421 unsigned debugNesting = 0;
422
423 /// RAII helper to increment/decrement debugNesting.
425 unsigned &depth;
426 DebugNesting(unsigned &depth) : depth(depth) { ++depth; }
428 };
429
430 raw_ostream &dbgs(unsigned extra = 0) {
431 return llvm::dbgs().indent(debugNesting * 2 + extra * 2);
432 }
433
434 llvm::indent indent(unsigned extra = 0) {
435 return llvm::indent(debugNesting, 2) + extra;
436 }
437#endif
438};
439
440/// Helper to enable printing objects in Diagnostics.
441static inline mlir::Diagnostic &
442operator<<(mlir::Diagnostic &diag,
443 const evaluator::EvaluatorValue &evaluatorValue) {
444 if (auto *attr = llvm::dyn_cast<evaluator::AttributeValue>(&evaluatorValue))
445 diag << attr->getAttr();
446 else if (auto *object =
447 llvm::dyn_cast<evaluator::ObjectValue>(&evaluatorValue))
448 diag << "Object(" << object->getType() << ")";
449 else if (auto *list = llvm::dyn_cast<evaluator::ListValue>(&evaluatorValue))
450 diag << "List(" << list->getType() << ")";
451 else if (auto *option =
452 llvm::dyn_cast<evaluator::OptionValue>(&evaluatorValue))
453 diag << "Option(" << option->getType() << ")";
454 else if (llvm::isa<evaluator::BasePathValue>(&evaluatorValue))
455 diag << "BasePath()";
456 else if (llvm::isa<evaluator::PathValue>(&evaluatorValue))
457 diag << "Path()";
458 else
459 assert(false && "unhandled evaluator value");
460
461 // Add unknown marker if the value is unknown
462 if (evaluatorValue.isUnknown())
463 diag << " [unknown]";
464 return diag;
465}
466
467/// Helper to enable printing objects in Diagnostics.
468static inline mlir::Diagnostic &
469operator<<(mlir::Diagnostic &diag, const EvaluatorValuePtr &evaluatorValue) {
470 if (!evaluatorValue)
471 return diag << "<null>";
472 return diag << *evaluatorValue.get();
473}
474
475#ifndef NDEBUG
476/// Helper to enable printing objects to raw_ostream (e.g., llvm::dbgs()).
477/// Delegates to the Diagnostic overload via an intermediate string.
478static inline llvm::raw_ostream &
479operator<<(llvm::raw_ostream &os,
480 const evaluator::EvaluatorValue &evaluatorValue) {
481 std::string buf;
482 llvm::raw_string_ostream ss(buf);
483 mlir::Diagnostic diag(UnknownLoc::get(evaluatorValue.getContext()),
484 mlir::DiagnosticSeverity::Note);
485 diag << evaluatorValue;
486 ss << diag;
487 return os << ss.str();
488}
489
490static inline llvm::raw_ostream &
491operator<<(llvm::raw_ostream &os, const EvaluatorValuePtr &evaluatorValue) {
492 if (evaluatorValue)
493 return os << *evaluatorValue.get();
494 return os << "<null>";
495}
496#endif // NDEBUG
497
498} // namespace om
499} // namespace circt
500
501#endif // CIRCT_DIALECT_OM_EVALUATOR_EVALUATOR_H
assert(baseType &&"element must be base type")
static std::unique_ptr< Context > context
FailureOr< evaluator::EvaluatorValuePtr > evaluateBasePathCreate(FrozenBasePathCreateOp op, ActualParameters actualParams, Location loc)
FailureOr< EvaluatorValuePtr > evaluateElaboratedObject(ElaboratedObjectOp op, ActualParameters actualParams, Location loc)
FailureOr< evaluator::EvaluatorValuePtr > evaluateEmptyPath(FrozenEmptyPathOp op, ActualParameters actualParams, Location loc)
FailureOr< evaluator::EvaluatorValuePtr > instantiate(StringAttr className, ArrayRef< EvaluatorValuePtr > actualParams)
Instantiate an Object with its class name and actual parameters.
SymbolTable symbolTable
The symbol table for the IR module the Evaluator was constructed with.
Definition Evaluator.h:414
FailureOr< evaluator::EvaluatorValuePtr > getPartiallyEvaluatedValue(Type type, Location loc)
FailureOr< EvaluatorValuePtr > evaluateValue(Value value, ActualParameters actualParams, Location loc)
Evaluate a Value in a Class body according to the small expression grammar described in the rationale...
FailureOr< EvaluatorValuePtr > evaluateConstant(ConstantOp op, ActualParameters actualParams, Location loc)
Evaluator dispatch function for constants.
DenseMap< Value, std::shared_ptr< evaluator::EvaluatorValue > > objects
Evaluator value storage for the current instantiation.
Definition Evaluator.h:417
FailureOr< EvaluatorValuePtr > evaluateOptionCreate(OptionCreateOp op, ActualParameters actualParams, Location loc)
mlir::ModuleOp getModule()
Get the Module this Evaluator is built from.
ArrayRef< EvaluatorValuePtr > ActualParameters
Definition Evaluator.h:358
FailureOr< evaluator::EvaluatorValuePtr > createUnknownValue(Type type, Location loc)
Create an unknown value of the specified type.
FailureOr< EvaluatorValuePtr > evaluateCollectionCreate(Operation *op, ActualParameters actualParams, Location loc)
Evaluator dispatch function for list and registry creation.
FailureOr< EvaluatorValuePtr > evaluateObjectInstance(StringAttr className, ActualParameters actualParams, Location loc)
Instantiate an Object with its class name and actual parameters.
llvm::indent indent(unsigned extra=0)
Definition Evaluator.h:434
unsigned debugNesting
Current nesting depth for debug output indentation.
Definition Evaluator.h:421
FailureOr< evaluator::EvaluatorValuePtr > evaluateUnknownValue(UnknownValueOp op, Location loc)
Evaluate an unknown value.
Evaluator(ModuleOp mod)
Construct an Evaluator with an IR module.
raw_ostream & dbgs(unsigned extra=0)
Definition Evaluator.h:430
FailureOr< EvaluatorValuePtr > getOrCreateValue(Value value, ActualParameters actualParams, Location loc)
FailureOr< evaluator::EvaluatorValuePtr > instantiateImpl(StringAttr className, ArrayRef< EvaluatorValuePtr > actualParams)
FailureOr< EvaluatorValuePtr > evaluateListConcat(ListConcatOp op, ActualParameters actualParams, Location loc)
Evaluator dispatch function for List concatenation.
FailureOr< EvaluatorValuePtr > evaluateParameter(BlockArgument formalParam, ActualParameters actualParams, Location loc)
Evaluator dispatch functions for the small expression grammar.
FailureOr< evaluator::EvaluatorValuePtr > evaluatePathCreate(FrozenPathCreateOp op, ActualParameters actualParams, Location loc)
LogicalResult setAttr(Attribute attr)
friend std::shared_ptr< EvaluatorValue > get(Attribute attr, LocationAttr loc)
static bool classof(const EvaluatorValue *e)
Definition Evaluator.h:110
static std::shared_ptr< EvaluatorValue > get(Type type, LocationAttr loc={})
AttributeValue(PrivateTag, Attribute attr, Location loc)
Definition Evaluator.h:129
static std::shared_ptr< EvaluatorValue > get(Attribute attr, LocationAttr loc={})
AttributeValue(PrivateTag, Type type, Location loc)
Definition Evaluator.h:136
BasePathValue(MLIRContext *context)
static bool classof(const EvaluatorValue *e)
Implement LLVM RTTI.
Definition Evaluator.h:288
void setBasepath(const BasePathValue &basepath)
Set the basepath which this path is relative to.
BasePathValue(om::PathAttr path, Location loc)
Create a path value representing a basepath.
Base class for evaluator runtime values.
Definition Evaluator.h:47
EvaluatorValue(MLIRContext *ctx, Kind kind, Location loc)
Definition Evaluator.h:51
void markUnknown()
Mark this value as unknown.
Definition Evaluator.h:72
MLIRContext * getContext()
Return the associated MLIR context.
Definition Evaluator.h:79
bool isUnknown() const
Return true if the value itself is unknown.
Definition Evaluator.h:66
MLIRContext * getContext() const
Definition Evaluator.h:54
static bool classof(const EvaluatorValue *e)
Implement LLVM RTTI.
Definition Evaluator.h:172
const auto & getElements() const
Definition Evaluator.h:166
ListValue(om::ListType type, Location loc)
Definition Evaluator.h:163
void setElements(SmallVector< EvaluatorValuePtr > newElements)
Definition Evaluator.h:157
SmallVector< EvaluatorValuePtr > elements
Definition Evaluator.h:178
ListValue(om::ListType type, SmallVector< EvaluatorValuePtr > elements, Location loc)
Definition Evaluator.h:150
om::ListType getListType() const
Return the type of the value, which is a ListType.
Definition Evaluator.h:169
A composite Object, which has a type and fields.
Definition Evaluator.h:226
om::ClassType getObjectType() const
Return the type of the value, which is a ClassType.
Definition Evaluator.h:247
FailureOr< EvaluatorValuePtr > getField(StringAttr field)
Get a field of the Object by name.
const auto & getFields() const
Definition Evaluator.h:239
FailureOr< EvaluatorValuePtr > getField(StringRef field)
Definition Evaluator.h:262
ArrayAttr getFieldNames()
Get all the field names of the Object.
static bool classof(const EvaluatorValue *e)
Implement LLVM RTTI.
Definition Evaluator.h:256
void setFields(llvm::SmallDenseMap< StringAttr, EvaluatorValuePtr > newFields)
Definition Evaluator.h:241
ObjectValue(om::ClassLike cls, Location loc)
Definition Evaluator.h:235
om::ClassLike getClassOp() const
Definition Evaluator.h:238
llvm::SmallDenseMap< StringAttr, EvaluatorValuePtr > fields
Definition Evaluator.h:271
ObjectValue(om::ClassLike cls, ObjectFields fields, Location loc)
Definition Evaluator.h:228
const EvaluatorValuePtr & getValue() const
Definition Evaluator.h:211
void setValue(EvaluatorValuePtr newValue)
Definition Evaluator.h:197
OptionValue(om::OptionType type, Location loc)
Definition Evaluator.h:187
OptionValue(om::OptionType type, EvaluatorValuePtr value, Location loc)
Definition Evaluator.h:191
om::OptionType getOptionType() const
Definition Evaluator.h:203
static bool classof(const EvaluatorValue *e)
Definition Evaluator.h:216
StringAttr getModule() const
Definition Evaluator.h:309
om::TargetKindAttr getTargetKind() const
Definition Evaluator.h:305
StringAttr getField() const
Definition Evaluator.h:313
om::TargetKindAttr targetKind
Definition Evaluator.h:325
void setBasepath(const BasePathValue &basepath)
om::PathAttr getPath() const
Definition Evaluator.h:307
PathValue(om::TargetKindAttr targetKind, om::PathAttr path, StringAttr module, StringAttr ref, StringAttr field, Location loc)
Create a path value representing a regular path.
static bool classof(const EvaluatorValue *e)
Implement LLVM RTTI.
Definition Evaluator.h:320
static PathValue getEmptyPath(Location loc)
StringAttr getRef() const
Definition Evaluator.h:311
SmallDenseMap< StringAttr, EvaluatorValuePtr > ObjectFields
The fields of a composite Object, currently represented as a map.
Definition Evaluator.h:41
std::shared_ptr< EvaluatorValue > EvaluatorValuePtr
A value of an object in memory.
Definition Evaluator.h:37
static mlir::Diagnostic & operator<<(mlir::Diagnostic &diag, const evaluator::EvaluatorValue &evaluatorValue)
Helper to enable printing objects in Diagnostics.
Definition Evaluator.h:442
evaluator::ObjectValue Object
Definition Evaluator.h:334
SmallVector< EvaluatorValuePtr > getEvaluatorValuesFromAttributes(MLIRContext *context, ArrayRef< Attribute > attributes)
evaluator::EvaluatorValuePtr EvaluatorValuePtr
Definition Evaluator.h:335
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition om.py:1