MLIR 23.0.0git
TosaProfileCompliance.cpp
Go to the documentation of this file.
1//===--- TosaProfileCompliance.cpp - Tosa Profile Compliance Validation ---===//
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
10#include "llvm/ADT/StringExtras.h"
11
12using namespace mlir;
13using namespace mlir::tosa;
14
16 const TypeInfo boolT = {mlir::IntegerType::getTypeID(), 1};
17 const TypeInfo i4T = {mlir::IntegerType::getTypeID(), 4};
18 const TypeInfo i8T = {mlir::IntegerType::getTypeID(), 8};
19 const TypeInfo i16T = {mlir::IntegerType::getTypeID(), 16};
20 const TypeInfo i32T = {mlir::IntegerType::getTypeID(), 32};
21 const TypeInfo i48T = {mlir::IntegerType::getTypeID(), 48};
22 const TypeInfo i64T = {mlir::IntegerType::getTypeID(), 64};
23 const TypeInfo bf16T = {mlir::BFloat16Type::getTypeID(), 16};
24 const TypeInfo fp16T = {mlir::Float16Type::getTypeID(), 16};
25 const TypeInfo fp32T = {mlir::Float32Type::getTypeID(), 32};
26 const TypeInfo fp8e4m3T = {mlir::Float8E4M3FNType::getTypeID(), 8};
27 const TypeInfo fp8e5m2T = {mlir::Float8E5M2Type::getTypeID(), 8};
28
29 // micro-scaling formats
30 const TypeInfo fp6e2m3T = {mlir::Float6E2M3FNType::getTypeID(), 6};
31 const TypeInfo fp6e3m2T = {mlir::Float6E3M2FNType::getTypeID(), 6};
32 const TypeInfo fp4e2m1T = {mlir::Float4E2M1FNType::getTypeID(), 4};
33 const TypeInfo fp8ue8m0T = {mlir::Float8E8M0FNUType::getTypeID(), 8};
34 const TypeInfo mxint8T = {mlir::tosa::mxint8Type::getTypeID(), 8};
35
36// The profile-based compliance content below is auto-generated by a script
37// in https://github.com/arm/tosa-specification
39 // End of auto-generated metadata
40}
41
42template <>
46
47template <>
50 return extensionComplianceMap;
51}
52
53// Base populating function
54LogicalResult ProfileInfoDepot::populateProfileInfo(ValueRange operands,
55 ValueRange results) {
56 for (const auto &operand : operands)
57 addValue(operand);
58 for (const auto &result : results)
60 return success();
61}
62
63template <>
64LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::ConcatOp op) {
65 addValue(op.getInput1().front());
66 addValue(op.getOutput());
67 return success();
68}
69
70template <>
71LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::AvgPool2dOp op) {
72 addValue(op.getInput());
73 addValue(op.getInputZp());
74 addValue(op.getOutputZp());
75 addType(op.getAccType());
76 addValue(op.getOutput());
77 return success();
78}
79
80template <>
81LogicalResult
82ProfileInfoDepot::populateProfileInfo(tosa::AvgPool2dAdaptiveOp op) {
83 addValue(op.getInput());
84 addValue(op.getInputZp());
85 addValue(op.getOutputZp());
86 addType(op.getAccType());
87 addValue(op.getOutput());
88 return success();
89}
90
91template <>
92LogicalResult
93ProfileInfoDepot::populateProfileInfo(tosa::MaxPool2dAdaptiveOp op) {
94 addValue(op.getInput());
95 addValue(op.getOutput());
96 return success();
97}
98
99template <typename T>
100LogicalResult ProfileInfoDepot::populateProfileInfoConv(T op) {
101 addValue(op.getInput());
102 addValue(op.getWeight());
103 addValue(op.getBias());
104 addValue(op.getInputZp());
105 addValue(op.getWeightZp());
106 addType(op.getAccType());
107 addValue(op.getOutput());
108 return success();
109}
110
111template <>
112LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::Conv2DOp op) {
113 return populateProfileInfoConv(op);
114}
115
116template <>
117LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::Conv3DOp op) {
118 return populateProfileInfoConv(op);
119}
120
121template <>
122LogicalResult
123ProfileInfoDepot::populateProfileInfo(tosa::TransposeConv2DOp op) {
124 return populateProfileInfoConv(op);
125}
126
127template <>
128LogicalResult
129ProfileInfoDepot::populateProfileInfo(tosa::DepthwiseConv2DOp op) {
130 return populateProfileInfoConv(op);
131}
132
133template <>
134LogicalResult
135ProfileInfoDepot::populateProfileInfo(tosa::Conv2DBlockScaledOp op) {
136 addValue(op.getInputData());
137 addValue(op.getInputScale());
138 addValue(op.getWeightData());
139 addValue(op.getWeightScale());
140 addValue(op.getBias());
141 addValue(op.getOutput());
142 return success();
143}
144
145template <>
146LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::PadOp op) {
147 addValue(op.getInput1());
148 addValue(op.getPadConst());
149 addValue(op.getOutput());
150 return success();
151}
152
153template <typename T>
154LogicalResult ProfileInfoDepot::populateProfileInfoDataLayout(T op) {
155 addValue(op.getInput1());
156 addValue(op.getOutput());
157 return success();
158}
159
160template <>
161LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::ReshapeOp op) {
162 return populateProfileInfoDataLayout(op);
163}
164
165template <>
166LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::SliceOp op) {
167 return populateProfileInfoDataLayout(op);
168}
169
170template <>
171LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::TileOp op) {
172 return populateProfileInfoDataLayout(op);
173}
174
175template <>
176LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::TransposeOp op) {
177 return populateProfileInfoDataLayout(op);
178}
179
180template <>
181LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::GatherOp op) {
182 addValue(op.getValues());
183 addValue(op.getIndices());
184 addValue(op.getOutput());
185 return success();
186}
187
188template <>
189LogicalResult
190ProfileInfoDepot::populateProfileInfo(tosa::RowGatherBlockScaledOp op) {
191 for (Value value : op.getValues())
192 addValue(value);
193 addValue(op.getIndices());
194 addValue(op.getRowCount());
195 for (Value result : op.getOutput())
197 return success();
198}
199
200template <>
201LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::ScatterOp op) {
202 addValue(op.getValuesIn());
203 addValue(op.getIndices());
204 addValue(op.getInput());
205 addValue(op.getValuesOut());
206 return success();
207}
208
209template <>
210LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::MulOp op) {
211 addValue(op.getInput1());
212 addValue(op.getInput2());
213 addValue(op.getOutput());
214 return success();
215}
216
217template <>
218LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::ResizeOp op) {
219 addValue(op.getInput());
220 addValue(op.getOutput());
221 return success();
222}
223
224template <>
225LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::SelectOp op) {
226 addValue(op.getOnTrue());
227 addValue(op.getOnFalse());
228 addValue(op.getOutput());
229 return success();
230}
231
232template <>
233LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::RescaleOp op) {
234 addValue(op.getInput());
235 addValue(op.getInputZp());
236 addValue(op.getOutputZp());
237 addValue(op.getOutput());
238 return success();
239}
240
241template <>
242LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::MatMulOp op) {
243 addValue(op.getA());
244 addValue(op.getB());
245 addValue(op.getAZp());
246 addValue(op.getBZp());
247 addValue(op.getOutput());
248 return success();
249}
250
251template <>
252LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::VariableOp op) {
253 addType(op.getType());
254 return success();
255}
256
257template <>
258LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::VariableWriteOp op) {
259 addValue(op.getInput1());
260 return success();
261}
262
263template <>
264LogicalResult ProfileInfoDepot::populateProfileInfo(tosa::DimOp op) {
265 addValue(op.getInput1());
266 return success();
267}
268
269LogicalResult ProfileInfoDepot::populatationDispatch(Operation *op) {
270// This helper function only populates the info for the customised operands.
271#define POPULATE_PROFILE_INFO_CUSTOM(tosaOp) \
272 if (isa<tosa::tosaOp##Op>(op)) { \
273 return populateProfileInfo(cast<tosa::tosaOp##Op>(op)); \
274 }
275
276#define POPULATE_PROFILE_INFO_SKIP(tosaOp) \
277 if (isa<tosa::tosaOp##Op>(op)) \
278 return success();
279
280// This helper function populates the info for all operands.
281#define POPULATE_PROFILE_INFO_COMMON(tosaOp) \
282 if (isa<tosa::tosaOp##Op>(op)) { \
283 return populateProfileInfo(op->getOperands(), op->getResults()); \
284 }
285
286 // Skip irrelevant operands when they are independent and not tied to any
287 // specific profile/extension.
289 POPULATE_PROFILE_INFO_CUSTOM(AvgPool2dAdaptive)
290 POPULATE_PROFILE_INFO_CUSTOM(TransposeConv2D)
292 POPULATE_PROFILE_INFO_CUSTOM(Conv2DBlockScaled)
294 POPULATE_PROFILE_INFO_CUSTOM(DepthwiseConv2D)
303 POPULATE_PROFILE_INFO_CUSTOM(RowGatherBlockScaled)
310 POPULATE_PROFILE_INFO_CUSTOM(VariableWrite)
312 POPULATE_PROFILE_INFO_CUSTOM(MaxPool2dAdaptive)
313
314 // For the most of tosa operators, all operands are profile/extension related
315 // and hence are all considered in this profile-based compilance check.
316 POPULATE_PROFILE_INFO_COMMON(MatmulTBlockScaled)
320 POPULATE_PROFILE_INFO_COMMON(CastFromBlockScaled)
321 POPULATE_PROFILE_INFO_COMMON(CastToBlockScaled)
333 POPULATE_PROFILE_INFO_COMMON(ArithmeticRightShift)
338 POPULATE_PROFILE_INFO_COMMON(LogicalLeftShift)
339 POPULATE_PROFILE_INFO_COMMON(LogicalRightShift)
362 POPULATE_PROFILE_INFO_COMMON(ReduceProduct)
365 POPULATE_PROFILE_INFO_COMMON(GreaterEqual)
369 POPULATE_PROFILE_INFO_COMMON(VariableRead)
370
371 // Type Invariant Extension, a capability extension that is independent
372 // of the data type, meaning any compatible type can be used. No type
373 // constraint for those operations.
375 POPULATE_PROFILE_INFO_SKIP(AssertEqualShape)
376 POPULATE_PROFILE_INFO_SKIP(ConcatShape)
378 POPULATE_PROFILE_INFO_SKIP(DivCeilShape)
379 POPULATE_PROFILE_INFO_SKIP(DivFloorShape)
381 POPULATE_PROFILE_INFO_SKIP(Log2CeilShape)
382 POPULATE_PROFILE_INFO_SKIP(Log2FloorShape)
392
393 return failure();
394}
395
396//===----------------------------------------------------------------------===//
397// Tosa Profile And Extension Compliance Checker
398//===----------------------------------------------------------------------===//
399
400template <typename T>
401FailureOr<SmallVector<OpComplianceInfo<T>>>
402TosaProfileCompliance::getOperatorMatchedEntries(Operation *op) {
403 const std::string opName = op->getName().getStringRef().str();
404 const auto complianceMap = getProfileComplianceMap<T>();
405 const auto it = complianceMap.find(opName);
406 if (it == complianceMap.end())
407 return {};
408
409 return findMatchedEntries<T>(op, it->second);
410}
411
412template <typename T>
414 Operation *op, const tosa::TargetEnv &targetEnv,
415 const SmallVector<ArrayRef<T>> &specRequiredModeSet) {
416
417 // None of profile requirement is set in the specification.
418 if (specRequiredModeSet.size() == 0)
419 return success();
420
421 const auto maybeOpEntries = getOperatorMatchedEntries<T>(op);
422 if (failed(maybeOpEntries)) {
423 // Operators such as control-flow and shape ops do not have an operand type
424 // restriction. When the profile compliance information of operation is not
425 // found, confirm if the target have enabled the profile required from the
426 // specification.
427 int modeCount = 0;
428 for (const auto &cands : specRequiredModeSet) {
429 if (targetEnv.allowsAnyOf(cands))
430 return success();
431 modeCount += cands.size();
432 }
433
434 op->emitOpError() << "illegal: requires"
435 << (modeCount > 1 ? " any of " : " ") << "["
436 << llvm::join(stringifyProfile<T>(specRequiredModeSet),
437 ", ")
438 << "] but not enabled in target\n";
439
440 return failure();
441 }
442
443 const auto opEntries = maybeOpEntries.value();
444 if (opEntries.size() == 0) {
445 // No matched restriction found.
446 return success();
447 }
448
449 // Check the profile/extension requirement according to the current target
450 // profiles/extensions.
451 const auto isModeAllowed = [&](const OpComplianceInfo<T> &info) -> bool {
452 if (info.condition == CheckCondition::allOf)
453 return targetEnv.allowsAllOf(info.mode);
454 return targetEnv.allowsAnyOf(info.mode);
455 };
456
457 // Check the matched op compliance version does not exceed the target
458 // specification version.
459 const TosaSpecificationVersion targetVersion{targetEnv.getSpecVersion()};
460 const auto isVersionCompatible =
461 [&targetVersion](const OpComplianceInfo<T> &info) -> bool {
462 const TosaSpecificationVersion complianceVersion{
463 info.operandTypeInfoSet.front().second};
464 return targetVersion.isBackwardsCompatibleWith(complianceVersion);
465 };
466
467 for (const auto &info : opEntries) {
468 // Ensure the profile compliance is compatible with the profile knowledge of
469 // the op definition.
470 assert(llvm::all_of(info.mode,
471 [&specRequiredModeSet](const T &mode) {
472 return llvm::is_contained(specRequiredModeSet.front(),
473 mode);
474 }) &&
475 "the profile/extension requirement of the operator should be "
476 "included in the profile compliance information");
477
478 if (isModeAllowed(info) && isVersionCompatible(info))
479 return success();
480 }
481
482 // No valid entry was found, now emit appropriate error message and return
483 // failure
484 std::string message;
485 llvm::raw_string_ostream os(message);
486
487 os << "illegal: ";
488 const size_t numOpEntries = opEntries.size();
489 for (const auto &[index, info] : llvm::enumerate(opEntries)) {
490 bool mismatchedVersion = false;
491 if (!isVersionCompatible(info)) {
492 mismatchedVersion = true;
493 os << "requires specification version compatible with "
494 << stringifyVersion(info.operandTypeInfoSet.front().second) << " (got "
495 << stringifyVersion(targetVersion) << ") ";
496 }
497
498 if (!isModeAllowed(info)) {
499 if (mismatchedVersion)
500 os << "and ";
501 os << "requires "
502 << (info.condition == CheckCondition::allOf ? "all of " : "any of ")
503 << "[" << llvm::join(stringifyProfile<T>(info.mode), ", ")
504 << "] profiles/extensions ";
505 }
506
507 if (index != numOpEntries - 1)
508 os << "OR ";
509 }
510 os << "to be specified in the target environment";
511
512 return op->emitOpError(message);
513}
514
515LogicalResult
517 const tosa::TargetEnv &targetEnv) {
518 if (auto interface = dyn_cast<tosa::QueryProfileInterface>(op))
519 return checkProfileOrExtension<Profile>(op, targetEnv,
520 interface.getProfiles());
521
522 return success();
523}
524
525LogicalResult
527 const tosa::TargetEnv &targetEnv) {
528 if (auto interface = dyn_cast<tosa::QueryExtensionInterface>(op))
529 return checkProfileOrExtension<Extension>(op, targetEnv,
530 interface.getExtensions());
531
532 return success();
533}
534
536 const auto maybeProfEntries = getOperatorMatchedEntries<Profile>(op);
537 const auto maybeExtEntries = getOperatorMatchedEntries<Extension>(op);
538 if (failed(maybeProfEntries) && failed(maybeExtEntries))
539 return success();
540
541 const bool hasEntry =
542 (succeeded(maybeProfEntries) && !maybeProfEntries.value().empty()) ||
543 (succeeded(maybeExtEntries) && !maybeExtEntries.value().empty());
544
545 if (!hasEntry) {
546 std::string message;
547 llvm::raw_string_ostream os(message);
548 os << "illegal: operation operand/result data types did not align with any "
549 "profile or extension, got (";
550
551 ProfileInfoDepot depot(op);
552 SmallVector<TypeInfo> current = depot.getInfo();
553 for (const auto &typeInfo : llvm::drop_end(current))
554 os << stringifyTypeInfo(typeInfo) << ",";
555 os << stringifyTypeInfo(current.back()) << ")";
556
557 // avoid polluting the error message output by outputting only
558 // the best match
559 const std::string opName = op->getName().getStringRef().str();
560 int maxMatches = -1;
561 SmallVector<TypeInfo> bestTypeInfo;
562 const auto searchBestMatch = [&](auto map) {
563 for (const auto &complianceInfos : map[opName]) {
564 for (const auto &versionedTypeInfos :
565 complianceInfos.operandTypeInfoSet) {
566 const SmallVector<TypeInfo> typeInfos = versionedTypeInfos.first;
567 if (current.size() != typeInfos.size())
568 continue;
569 const int matches = llvm::count_if(
570 llvm::zip_equal(current, typeInfos), [&](const auto zipType) {
571 return isSameTypeInfo(std::get<0>(zipType),
572 std::get<1>(zipType));
573 });
574 if (matches > maxMatches) {
575 maxMatches = matches;
576 bestTypeInfo = typeInfos;
577 }
578 }
579 }
580 };
581 searchBestMatch(getProfileComplianceMap<Profile>());
582 searchBestMatch(getProfileComplianceMap<Extension>());
583
584 os << ", did you mean (";
585 for (const auto &typeInfo : llvm::drop_end(bestTypeInfo))
586 os << stringifyTypeInfo(typeInfo) << ",";
587 os << stringifyTypeInfo(bestTypeInfo.back()) << ")? ";
588 os << "Otherwise, please refer to the 'supported data types' for '"
589 << opName << "' in the specification.";
590 op->emitOpError(message);
591 return failure();
592 }
593
594 return success();
595}
596
597// Find the profiles or extensions requirement according to the signature of
598// type of the operand list.
599template <typename T>
602 assert(compInfo.size() != 0 &&
603 "profile-based compliance information is empty");
604
605 // Populate the type of profile/extension relevant operands.
606 ProfileInfoDepot depot(op);
607 SmallVector<TypeInfo> present = depot.getInfo();
608 if (present.size() == 0)
609 return {};
610
612 for (size_t i = 0; i < compInfo.size(); i++) {
613 SmallVector<VersionedTypeInfo> sets = compInfo[i].operandTypeInfoSet;
614 for (const auto &set : sets) {
615 SmallVector<TypeInfo> expected = set.first;
616 // Tensor-list operators can legitimately have multiple valid signatures
617 // with different operand/result counts, e.g. data-only and data+scale
618 // forms. Treat those as non-matches instead of asserting.
619 if (present.size() != expected.size())
620 continue;
621
622 bool isFound = true;
623 // Compare the type signature between the given operation and the
624 // compliance metadata.
625 for (size_t j = 0; j < expected.size(); j++) {
626 if (!isSameTypeInfo(present[j], expected[j])) {
627 // Verify the next mode set from the list.
628 isFound = false;
629 break;
630 }
631 }
632
633 if (isFound == true) {
634 SmallVector<VersionedTypeInfo> typeInfoSet{set};
635 OpComplianceInfo<T> info{compInfo[i].mode, typeInfoSet,
636 compInfo[i].condition};
637 matchedInfos.push_back(info);
638 }
639 }
640 }
641
642 return matchedInfos;
643}
644
645// Debug utilites.
646template <typename T>
649 SmallVector<StringRef> debugStrings;
650 for (const auto &profile : profiles) {
651 if constexpr (std::is_same_v<T, Profile>)
652 debugStrings.push_back(tosa::stringifyProfile(profile));
653 else
654 debugStrings.push_back(tosa::stringifyExtension(profile));
655 }
656 return debugStrings;
657}
658
659template <typename T>
661 const SmallVector<ArrayRef<T>> &profileSet) {
662 SmallVector<StringRef> debugStrings;
663
664 for (const auto &profiles : profileSet) {
665 auto tempStrings = stringifyProfile<T>(profiles);
666 llvm::append_range(debugStrings, tempStrings);
667 }
668
669 return debugStrings;
670}
671
674 if (typeInfo.typeID == mlir::IntegerType::getTypeID()) {
675 return {"i" + llvm::utostr(typeInfo.bitWidth)};
676 }
677 if (typeInfo.typeID == mlir::Float16Type::getTypeID()) {
678 return {"f16"};
679 } else if (typeInfo.typeID == mlir::Float32Type::getTypeID()) {
680 return {"f32"};
681 } else if (typeInfo.typeID == mlir::BFloat16Type::getTypeID()) {
682 return {"bf16"};
683 } else if (typeInfo.typeID == mlir::Float8E4M3FNType::getTypeID()) {
684 return {"fp8e4m3"};
685 } else if (typeInfo.typeID == mlir::Float8E5M2Type::getTypeID()) {
686 return {"fp8e5m2"};
687 } else if (typeInfo.typeID == mlir::Float6E2M3FNType::getTypeID()) {
688 return {"fp6e2m3"};
689 } else if (typeInfo.typeID == mlir::Float6E3M2FNType::getTypeID()) {
690 return {"fp6e3m2"};
691 } else if (typeInfo.typeID == mlir::Float4E2M1FNType::getTypeID()) {
692 return {"fp4e2m1"};
693 } else if (typeInfo.typeID == mlir::Float8E8M0FNUType::getTypeID()) {
694 return {"fp8e8m0"};
695 } else if (typeInfo.typeID == tosa::mxint8Type::getTypeID()) {
696 return {"mxint8"};
697 }
698 llvm_unreachable("unknown type");
699}
return success()
#define POPULATE_PROFILE_INFO_CUSTOM(tosaOp)
#define POPULATE_PROFILE_INFO_COMMON(tosaOp)
#define POPULATE_PROFILE_INFO_SKIP(tosaOp)
std::unordered_map< std::string, SmallVector< OpComplianceInfo< Profile > > > OperationProfileComplianceMap
std::unordered_map< std::string, SmallVector< OpComplianceInfo< Extension > > > OperationExtensionComplianceMap
@ Gather
SmallVector< TypeInfo > getInfo()
bool isSameTypeInfo(TypeInfo a, TypeInfo b)
LogicalResult checkProfile(Operation *op, const tosa::TargetEnv &targetEnv)
LogicalResult checkExtension(Operation *op, const tosa::TargetEnv &targetEnv)
LogicalResult checkInvalid(Operation *op)
SmallVector< StringRef > stringifyProfile(ArrayRef< T > profiles)
LogicalResult checkProfileOrExtension(Operation *op, const tosa::TargetEnv &targetEnv, const SmallVector< ArrayRef< T > > &specDefinedProfileSet)
static llvm::SmallString< 7 > stringifyTypeInfo(const TypeInfo &typeInfo)
std::unordered_map< std::string, SmallVector< OpComplianceInfo< T > > > getProfileComplianceMap()
SmallVector< OpComplianceInfo< T > > findMatchedEntries(Operation *op, SmallVector< OpComplianceInfo< T > > compInfo)
StringRef getStringRef() const
Return the name of this operation. This always succeeds.
Operation is the basic unit of execution within MLIR.
Definition Operation.h:88
OperationName getName()
The name of an operation is the key identifier for it.
Definition Operation.h:116
InFlightDiagnostic emitOpError(const Twine &message={})
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers.
This class provides an abstraction over the different types of ranges over Values.
Definition ValueRange.h:389
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
This class represents the capability enabled in the target implementation such as profile,...
Definition TargetEnv.h:117
bool allowsAllOf(ArrayRef< Profile > profs) const
Definition TargetEnv.h:150
bool allowsAnyOf(ArrayRef< Profile > profs) const
Definition TargetEnv.h:146
TosaSpecificationVersion getSpecVersion() const
Definition TargetEnv.h:130
A thin wrapper around the SpecificationVersion enum to represent and provide utilities around the TOS...
Definition TargetEnv.h:58
bool isBackwardsCompatibleWith(TosaSpecificationVersion baseVersion) const
Definition TargetEnv.h:67
llvm::SmallString< 4 > stringifyVersion(TosaSpecificationVersion version)
Definition TargetEnv.cpp:15
Include the generated interface declarations.
@ Mul
RHS of mul is always a constant or a symbolic expression.
Definition AffineExpr.h:43
mlir::TypeID typeID
Eliminates variable at the specified position using Fourier-Motzkin variable elimination.