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