CIRCT 23.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/SmallPtrSet.h"
25#include "llvm/ADT/SmallString.h"
26
27#include <queue>
28#include <utility>
29
30namespace circt {
31namespace om {
32
33namespace evaluator {
34class EvaluatorValue;
35
36/// A value of an object in memory. It is either a composite Object, or a
37/// primitive Attribute. Further refinement is expected.
38using EvaluatorValuePtr = std::shared_ptr<EvaluatorValue>;
39
40/// The fields of a composite Object, currently represented as a map. Further
41/// refinement is expected.
43
44/// Base class for evaluator runtime values.
45/// Enables the shared_from_this functionality so Evaluator Value pointers can
46/// be passed through the CAPI and unwrapped back into C++ smart pointers with
47/// the appropriate reference count.
48class EvaluatorValue : public std::enable_shared_from_this<EvaluatorValue> {
49public:
50 // Implement LLVM RTTI.
51 enum class Kind { Attr, Object, List, Reference, BasePath, Path };
52 EvaluatorValue(MLIRContext *ctx, Kind kind, Location loc)
53 : kind(kind), ctx(ctx), loc(loc) {}
54 Kind getKind() const { return kind; }
55 MLIRContext *getContext() const { return ctx; }
56
57 // Return true the value is fully evaluated.
58 // Unknown values are considered fully evaluated.
59 bool isFullyEvaluated() const { return fullyEvaluated; }
61 assert(!fullyEvaluated && "should not mark twice");
62 fullyEvaluated = true;
63 }
64
65 /// Return true if the value is unknown (has unknown in its fan-in).
66 /// A value is unknown if it depends on an UnknownValueOp or if any of its
67 /// inputs are unknown. Unknown values propagate through operations.
68 bool isUnknown() const { return unknown; }
69
70 /// Mark this value as unknown.
71 /// This also marks the value as fully evaluated if it isn't already, since
72 /// unknown values are considered fully evaluated. This maintains the
73 /// invariant that unknown implies fullyEvaluated.
74 void markUnknown() {
75 unknown = true;
76 if (!fullyEvaluated)
78 }
79
80 /// Return the associated MLIR context.
81 MLIRContext *getContext() { return ctx; }
82
83 // Return a MLIR type which the value represents.
84 Type getType() const;
85
86 // Finalize the evaluator value. Strip intermidiate reference values.
87 LogicalResult finalize();
88
89 // Return the Location associated with the Value.
90 Location getLoc() const { return loc; }
91 // Set the Location associated with the Value.
92 void setLoc(Location l) { loc = l; }
93 // Set the Location, if it is unknown.
94 void setLocIfUnknown(Location l) {
95 if (isa<UnknownLoc>(loc))
96 loc = l;
97 }
98
99private:
100 const Kind kind;
101 MLIRContext *ctx;
102 Location loc;
103 bool fullyEvaluated = false;
104 bool finalized = false;
105 bool unknown = false;
106};
107
108/// Values which can be used as pointers to different values.
109/// ReferenceValue is replaced with its element and erased at the end of
110/// evaluation.
112public:
113 ReferenceValue(Type type, Location loc)
115 type(type) {}
116
117 // Implement LLVM RTTI.
118 static bool classof(const EvaluatorValue *e) {
119 return e->getKind() == Kind::Reference;
120 }
121
122 Type getValueType() const { return type; }
123 EvaluatorValuePtr getValue() const { return value; }
125 value = std::move(newValue);
127 }
128
129 // Finalize the value.
130 LogicalResult finalizeImpl();
131
132 // Return the first non-reference value that is reachable from the reference.
133 FailureOr<EvaluatorValuePtr> getStrippedValue() const {
134 llvm::SmallPtrSet<ReferenceValue *, 4> visited;
135 auto currentValue = value;
136 while (auto *v = dyn_cast<ReferenceValue>(currentValue.get())) {
137 // Detect a cycle.
138 if (!visited.insert(v).second)
139 return failure();
140 currentValue = v->getValue();
141 }
142 return success(currentValue);
143 }
144
145private:
147 Type type;
148};
149
150/// Values which can be directly representable by MLIR attributes.
152public:
153 Attribute getAttr() const { return attr; }
154 template <typename AttrTy>
155 AttrTy getAs() const {
156 return dyn_cast<AttrTy>(attr);
157 }
158 static bool classof(const EvaluatorValue *e) {
159 return e->getKind() == Kind::Attr;
160 }
161
162 // Set Attribute for partially evaluated case.
163 LogicalResult setAttr(Attribute attr);
164
165 // Finalize the value.
166 LogicalResult finalizeImpl();
167
168 Type getType() const { return type; }
169
170 // Factory methods that create AttributeValue objects
171 static std::shared_ptr<EvaluatorValue> get(Attribute attr,
172 LocationAttr loc = {});
173 static std::shared_ptr<EvaluatorValue> get(Type type, LocationAttr loc = {});
174
175private:
176 // Make AttributeValue constructible only by the factory methods
177 struct PrivateTag {};
178
179 // Constructor that requires a PrivateTag
180 AttributeValue(PrivateTag, Attribute attr, Location loc)
182 type(cast<TypedAttr>(attr).getType()) {
184 }
185
186 // Constructor for partially evaluated AttributeValue
189
190 Attribute attr = {};
191 Type type;
192
193 // Friend declaration for the factory methods
194 friend std::shared_ptr<EvaluatorValue> get(Attribute attr, LocationAttr loc);
195 friend std::shared_ptr<EvaluatorValue> get(Type type, LocationAttr loc);
196};
197
198// This perform finalization to `value`.
199static inline LogicalResult finalizeEvaluatorValue(EvaluatorValuePtr &value) {
200 if (failed(value->finalize()))
201 return failure();
202 if (auto *ref = llvm::dyn_cast<ReferenceValue>(value.get())) {
203 auto v = ref->getStrippedValue();
204 if (failed(v))
205 return v;
206 value = v.value();
207 }
208 return success();
209}
210
211/// A List which contains variadic length of elements with the same type.
212class ListValue : public EvaluatorValue {
213public:
214 ListValue(om::ListType type, SmallVector<EvaluatorValuePtr> elements,
215 Location loc)
217 elements(std::move(elements)) {
219 }
220
221 void setElements(SmallVector<EvaluatorValuePtr> newElements) {
222 elements = std::move(newElements);
224 }
225
226 // Finalize the value.
227 LogicalResult finalizeImpl();
228
229 // Partially evaluated value.
230 ListValue(om::ListType type, Location loc)
232
233 const auto &getElements() const { return elements; }
234
235 /// Return the type of the value, which is a ListType.
236 om::ListType getListType() const { return type; }
237
238 /// Implement LLVM RTTI.
239 static bool classof(const EvaluatorValue *e) {
240 return e->getKind() == Kind::List;
241 }
242
243private:
244 om::ListType type;
245 SmallVector<EvaluatorValuePtr> elements;
246};
247
248/// A composite Object, which has a type and fields.
250public:
251 ObjectValue(om::ClassLike cls, ObjectFields fields, Location loc)
253 fields(std::move(fields)) {
255 }
256
257 // Partially evaluated value.
258 ObjectValue(om::ClassLike cls, Location loc)
260
261 om::ClassLike getClassOp() const { return cls; }
262 const auto &getFields() const { return fields; }
263
265 fields = std::move(newFields);
267 }
268
269 /// Return the type of the value, which is a ClassType.
270 om::ClassType getObjectType() const {
271 auto clsNonConst = const_cast<om::ClassLike &>(cls);
272 return ClassType::get(clsNonConst.getContext(),
273 FlatSymbolRefAttr::get(clsNonConst.getSymNameAttr()));
274 }
275
276 Type getType() const { return getObjectType(); }
277
278 /// Implement LLVM RTTI.
279 static bool classof(const EvaluatorValue *e) {
280 return e->getKind() == Kind::Object;
281 }
282
283 /// Get a field of the Object by name.
284 FailureOr<EvaluatorValuePtr> getField(StringAttr field);
285 FailureOr<EvaluatorValuePtr> getField(StringRef field) {
286 return getField(StringAttr::get(getContext(), field));
287 }
288
289 /// Get all the field names of the Object.
290 ArrayAttr getFieldNames();
291
292 // Finalize the evaluator value.
293 LogicalResult finalizeImpl();
294
295private:
296 om::ClassLike cls;
298};
299
300/// A Basepath value.
302public:
303 BasePathValue(MLIRContext *context);
304
305 /// Create a path value representing a basepath.
306 BasePathValue(om::PathAttr path, Location loc);
307
308 om::PathAttr getPath() const;
309
310 /// Set the basepath which this path is relative to.
311 void setBasepath(const BasePathValue &basepath);
312
313 /// Finalize the evaluator value.
314 LogicalResult finalizeImpl() { return success(); }
315
316 /// Implement LLVM RTTI.
317 static bool classof(const EvaluatorValue *e) {
318 return e->getKind() == Kind::BasePath;
319 }
320
321private:
322 om::PathAttr path;
323};
324
325/// A Path value.
326class PathValue : public EvaluatorValue {
327public:
328 /// Create a path value representing a regular path.
329 PathValue(om::TargetKindAttr targetKind, om::PathAttr path, StringAttr module,
330 StringAttr ref, StringAttr field, Location loc);
331
332 static PathValue getEmptyPath(Location loc);
333
334 om::TargetKindAttr getTargetKind() const { return targetKind; }
335
336 om::PathAttr getPath() const { return path; }
337
338 StringAttr getModule() const { return module; }
339
340 StringAttr getRef() const { return ref; }
341
342 StringAttr getField() const { return field; }
343
344 StringAttr getAsString() const;
345
346 void setBasepath(const BasePathValue &basepath);
347
348 // Finalize the evaluator value.
349 LogicalResult finalizeImpl() { return success(); }
350
351 /// Implement LLVM RTTI.
352 static bool classof(const EvaluatorValue *e) {
353 return e->getKind() == Kind::Path;
354 }
355
356private:
357 om::TargetKindAttr targetKind;
358 om::PathAttr path;
359 StringAttr module;
360 StringAttr ref;
361 StringAttr field;
362};
363
364} // namespace evaluator
365
368
369SmallVector<EvaluatorValuePtr>
371 ArrayRef<Attribute> attributes);
372
373/// An Evaluator, which is constructed with an IR module and can instantiate
374/// Objects. Further refinement is expected.
376public:
377 /// Construct an Evaluator with an IR module.
378 Evaluator(ModuleOp mod);
379
380 /// Instantiate an Object with its class name and actual parameters.
381 FailureOr<evaluator::EvaluatorValuePtr>
382 instantiate(StringAttr className, ArrayRef<EvaluatorValuePtr> actualParams);
383
384 /// Get the Module this Evaluator is built from.
385 mlir::ModuleOp getModule();
386
387 FailureOr<evaluator::EvaluatorValuePtr>
388 getPartiallyEvaluatedValue(Type type, Location loc);
389
391 SmallVectorImpl<std::shared_ptr<evaluator::EvaluatorValue>> *;
392
393 using ObjectKey = std::pair<Value, ActualParameters>;
394
395private:
396 bool isFullyEvaluated(Value value, ActualParameters key) {
397 return isFullyEvaluated({value, key});
398 }
399
401 auto val = objects.lookup(key);
402 return val && val->isFullyEvaluated();
403 }
404
405 FailureOr<EvaluatorValuePtr>
406 getOrCreateValue(Value value, ActualParameters actualParams, Location loc);
407 FailureOr<EvaluatorValuePtr>
408 allocateObjectInstance(StringAttr clasName, ActualParameters actualParams);
409
410 /// Evaluate a Value in a Class body according to the small expression grammar
411 /// described in the rationale document. The actual parameters are the values
412 /// supplied at the current instantiation of the Class being evaluated.
413 FailureOr<EvaluatorValuePtr>
414 evaluateValue(Value value, ActualParameters actualParams, Location loc);
415
416 /// Evaluator dispatch functions for the small expression grammar.
417 FailureOr<EvaluatorValuePtr> evaluateParameter(BlockArgument formalParam,
418 ActualParameters actualParams,
419 Location loc);
420
421 FailureOr<EvaluatorValuePtr>
422 evaluateConstant(ConstantOp op, ActualParameters actualParams, Location loc);
423
424 FailureOr<EvaluatorValuePtr>
425 evaluateIntegerBinaryArithmetic(IntegerBinaryArithmeticOp op,
426 ActualParameters actualParams, Location loc);
427
428 /// Instantiate an Object with its class name and actual parameters.
429 FailureOr<EvaluatorValuePtr>
430 evaluateObjectInstance(StringAttr className, ActualParameters actualParams,
431 Location loc, ObjectKey instanceKey = {});
432 FailureOr<EvaluatorValuePtr>
433 evaluateObjectInstance(ObjectOp op, ActualParameters actualParams);
434 FailureOr<EvaluatorValuePtr>
435 evaluateObjectField(ObjectFieldOp op, ActualParameters actualParams,
436 Location loc);
437 FailureOr<EvaluatorValuePtr> evaluateListCreate(ListCreateOp op,
438 ActualParameters actualParams,
439 Location loc);
440 FailureOr<EvaluatorValuePtr> evaluateListConcat(ListConcatOp op,
441 ActualParameters actualParams,
442 Location loc);
443 FailureOr<evaluator::EvaluatorValuePtr>
444 evaluateBasePathCreate(FrozenBasePathCreateOp op,
445 ActualParameters actualParams, Location loc);
446 FailureOr<evaluator::EvaluatorValuePtr>
447 evaluatePathCreate(FrozenPathCreateOp op, ActualParameters actualParams,
448 Location loc);
449 FailureOr<evaluator::EvaluatorValuePtr>
450 evaluateEmptyPath(FrozenEmptyPathOp op, ActualParameters actualParams,
451 Location loc);
452 FailureOr<evaluator::EvaluatorValuePtr>
453 evaluateUnknownValue(UnknownValueOp op, Location loc);
454
455 FailureOr<ActualParameters>
456 createParametersFromOperands(ValueRange range, ActualParameters actualParams,
457 Location loc);
458
459 /// The symbol table for the IR module the Evaluator was constructed with.
460 /// Used to look up class definitions.
461 SymbolTable symbolTable;
462
463 /// This uniquely stores vectors that represent parameters.
464 SmallVector<
465 std::unique_ptr<SmallVector<std::shared_ptr<evaluator::EvaluatorValue>>>>
467
468 /// A worklist that tracks values which needs to be fully evaluated.
469 std::queue<ObjectKey> worklist;
470
471 /// Evaluator value storage. Return an evaluator value for the given
472 /// instantiation context (a pair of Value and parameters).
473 DenseMap<ObjectKey, std::shared_ptr<evaluator::EvaluatorValue>> objects;
474};
475
476/// Helper to enable printing objects in Diagnostics.
477static inline mlir::Diagnostic &
478operator<<(mlir::Diagnostic &diag,
479 const evaluator::EvaluatorValue &evaluatorValue) {
480 if (auto *attr = llvm::dyn_cast<evaluator::AttributeValue>(&evaluatorValue))
481 diag << attr->getAttr();
482 else if (auto *object =
483 llvm::dyn_cast<evaluator::ObjectValue>(&evaluatorValue))
484 diag << "Object(" << object->getType() << ")";
485 else if (auto *list = llvm::dyn_cast<evaluator::ListValue>(&evaluatorValue))
486 diag << "List(" << list->getType() << ")";
487 else if (llvm::isa<evaluator::BasePathValue>(&evaluatorValue))
488 diag << "BasePath()";
489 else if (llvm::isa<evaluator::PathValue>(&evaluatorValue))
490 diag << "Path()";
491 else
492 assert(false && "unhandled evaluator value");
493
494 // Add unknown marker if the value is unknown
495 if (evaluatorValue.isUnknown())
496 diag << " [unknown]";
497 return diag;
498}
499
500/// Helper to enable printing objects in Diagnostics.
501static inline mlir::Diagnostic &
502operator<<(mlir::Diagnostic &diag, const EvaluatorValuePtr &evaluatorValue) {
503 return diag << *evaluatorValue.get();
504}
505
506} // namespace om
507} // namespace circt
508
509#endif // CIRCT_DIALECT_OM_EVALUATOR_EVALUATOR_H
assert(baseType &&"element must be base type")
static std::unique_ptr< Context > context
An Evaluator, which is constructed with an IR module and can instantiate Objects.
Definition Evaluator.h:375
FailureOr< evaluator::EvaluatorValuePtr > evaluateBasePathCreate(FrozenBasePathCreateOp op, ActualParameters actualParams, Location loc)
FailureOr< evaluator::EvaluatorValuePtr > evaluateEmptyPath(FrozenEmptyPathOp op, ActualParameters actualParams, Location loc)
SymbolTable symbolTable
The symbol table for the IR module the Evaluator was constructed with.
Definition Evaluator.h:461
FailureOr< evaluator::EvaluatorValuePtr > getPartiallyEvaluatedValue(Type type, Location loc)
Definition Evaluator.cpp:70
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.
FailureOr< EvaluatorValuePtr > evaluateIntegerBinaryArithmetic(IntegerBinaryArithmeticOp op, ActualParameters actualParams, Location loc)
mlir::ModuleOp getModule()
Get the Module this Evaluator is built from.
Definition Evaluator.cpp:30
FailureOr< EvaluatorValuePtr > evaluateObjectField(ObjectFieldOp op, ActualParameters actualParams, Location loc)
Evaluator dispatch function for Object fields.
SmallVector< std::unique_ptr< SmallVector< std::shared_ptr< evaluator::EvaluatorValue > > > > actualParametersBuffers
This uniquely stores vectors that represent parameters.
Definition Evaluator.h:466
bool isFullyEvaluated(Value value, ActualParameters key)
Definition Evaluator.h:396
FailureOr< EvaluatorValuePtr > allocateObjectInstance(StringAttr clasName, ActualParameters actualParams)
std::queue< ObjectKey > worklist
A worklist that tracks values which needs to be fully evaluated.
Definition Evaluator.h:469
FailureOr< evaluator::EvaluatorValuePtr > evaluateUnknownValue(UnknownValueOp op, Location loc)
FailureOr< evaluator::EvaluatorValuePtr > instantiate(StringAttr className, ArrayRef< EvaluatorValuePtr > actualParams)
Instantiate an Object with its class name and actual parameters.
FailureOr< EvaluatorValuePtr > getOrCreateValue(Value value, ActualParameters actualParams, Location loc)
Definition Evaluator.cpp:96
SmallVectorImpl< std::shared_ptr< evaluator::EvaluatorValue > > * ActualParameters
Definition Evaluator.h:391
DenseMap< ObjectKey, std::shared_ptr< evaluator::EvaluatorValue > > objects
Evaluator value storage.
Definition Evaluator.h:473
FailureOr< EvaluatorValuePtr > evaluateListCreate(ListCreateOp op, ActualParameters actualParams, Location loc)
Evaluator dispatch function for List creation.
FailureOr< EvaluatorValuePtr > evaluateListConcat(ListConcatOp op, ActualParameters actualParams, Location loc)
Evaluator dispatch function for List concatenation.
std::pair< Value, ActualParameters > ObjectKey
Definition Evaluator.h:393
FailureOr< EvaluatorValuePtr > evaluateParameter(BlockArgument formalParam, ActualParameters actualParams, Location loc)
Evaluator dispatch functions for the small expression grammar.
FailureOr< EvaluatorValuePtr > evaluateObjectInstance(StringAttr className, ActualParameters actualParams, Location loc, ObjectKey instanceKey={})
Instantiate an Object with its class name and actual parameters.
FailureOr< evaluator::EvaluatorValuePtr > evaluatePathCreate(FrozenPathCreateOp op, ActualParameters actualParams, Location loc)
FailureOr< ActualParameters > createParametersFromOperands(ValueRange range, ActualParameters actualParams, Location loc)
Evaluator dispatch function for Object instances.
bool isFullyEvaluated(ObjectKey key)
Definition Evaluator.h:400
Values which can be directly representable by MLIR attributes.
Definition Evaluator.h:151
LogicalResult setAttr(Attribute attr)
friend std::shared_ptr< EvaluatorValue > get(Attribute attr, LocationAttr loc)
static bool classof(const EvaluatorValue *e)
Definition Evaluator.h:158
AttributeValue(PrivateTag, Attribute attr, Location loc)
Definition Evaluator.h:180
friend std::shared_ptr< EvaluatorValue > get(Type type, LocationAttr loc)
AttributeValue(PrivateTag, Type type, Location loc)
Definition Evaluator.h:187
static bool classof(const EvaluatorValue *e)
Implement LLVM RTTI.
Definition Evaluator.h:317
LogicalResult finalizeImpl()
Finalize the evaluator value.
Definition Evaluator.h:314
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:48
EvaluatorValue(MLIRContext *ctx, Kind kind, Location loc)
Definition Evaluator.h:52
void markUnknown()
Mark this value as unknown.
Definition Evaluator.h:74
MLIRContext * getContext()
Return the associated MLIR context.
Definition Evaluator.h:81
bool isUnknown() const
Return true if the value is unknown (has unknown in its fan-in).
Definition Evaluator.h:68
MLIRContext * getContext() const
Definition Evaluator.h:55
A List which contains variadic length of elements with the same type.
Definition Evaluator.h:212
static bool classof(const EvaluatorValue *e)
Implement LLVM RTTI.
Definition Evaluator.h:239
const auto & getElements() const
Definition Evaluator.h:233
ListValue(om::ListType type, Location loc)
Definition Evaluator.h:230
void setElements(SmallVector< EvaluatorValuePtr > newElements)
Definition Evaluator.h:221
SmallVector< EvaluatorValuePtr > elements
Definition Evaluator.h:245
ListValue(om::ListType type, SmallVector< EvaluatorValuePtr > elements, Location loc)
Definition Evaluator.h:214
om::ListType getListType() const
Return the type of the value, which is a ListType.
Definition Evaluator.h:236
A composite Object, which has a type and fields.
Definition Evaluator.h:249
om::ClassType getObjectType() const
Return the type of the value, which is a ClassType.
Definition Evaluator.h:270
FailureOr< EvaluatorValuePtr > getField(StringAttr field)
Get a field of the Object by name.
const auto & getFields() const
Definition Evaluator.h:262
FailureOr< EvaluatorValuePtr > getField(StringRef field)
Definition Evaluator.h:285
ArrayAttr getFieldNames()
Get all the field names of the Object.
static bool classof(const EvaluatorValue *e)
Implement LLVM RTTI.
Definition Evaluator.h:279
void setFields(llvm::SmallDenseMap< StringAttr, EvaluatorValuePtr > newFields)
Definition Evaluator.h:264
ObjectValue(om::ClassLike cls, Location loc)
Definition Evaluator.h:258
om::ClassLike getClassOp() const
Definition Evaluator.h:261
llvm::SmallDenseMap< StringAttr, EvaluatorValuePtr > fields
Definition Evaluator.h:297
ObjectValue(om::ClassLike cls, ObjectFields fields, Location loc)
Definition Evaluator.h:251
StringAttr getModule() const
Definition Evaluator.h:338
StringAttr StringAttr ref
Definition Evaluator.h:360
StringAttr getAsString() const
om::TargetKindAttr getTargetKind() const
Definition Evaluator.h:334
StringAttr getField() const
Definition Evaluator.h:342
om::TargetKindAttr targetKind
Definition Evaluator.h:357
void setBasepath(const BasePathValue &basepath)
om::PathAttr getPath() const
Definition Evaluator.h:336
static bool classof(const EvaluatorValue *e)
Implement LLVM RTTI.
Definition Evaluator.h:352
static PathValue getEmptyPath(Location loc)
StringAttr getRef() const
Definition Evaluator.h:340
Values which can be used as pointers to different values.
Definition Evaluator.h:111
EvaluatorValuePtr getValue() const
Definition Evaluator.h:123
static bool classof(const EvaluatorValue *e)
Definition Evaluator.h:118
ReferenceValue(Type type, Location loc)
Definition Evaluator.h:113
FailureOr< EvaluatorValuePtr > getStrippedValue() const
Definition Evaluator.h:133
void setValue(EvaluatorValuePtr newValue)
Definition Evaluator.h:124
static LogicalResult finalizeEvaluatorValue(EvaluatorValuePtr &value)
Definition Evaluator.h:199
std::shared_ptr< EvaluatorValue > EvaluatorValuePtr
A value of an object in memory.
Definition Evaluator.h:38
evaluator::EvaluatorValuePtr EvaluatorValuePtr
Definition Evaluator.h:367
static mlir::Diagnostic & operator<<(mlir::Diagnostic &diag, const evaluator::EvaluatorValue &evaluatorValue)
Helper to enable printing objects in Diagnostics.
Definition Evaluator.h:478
SmallVector< EvaluatorValuePtr > getEvaluatorValuesFromAttributes(MLIRContext *context, ArrayRef< Attribute > attributes)
Definition Evaluator.cpp:35
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition om.py:1