MLIR 24.0.0git
PDL.cpp
Go to the documentation of this file.
1//===- PDL.cpp - Pattern Descriptor Language Dialect ----------------------===//
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
13#include "llvm/ADT/TypeSwitch.h"
14#include <optional>
15
16using namespace mlir;
17using namespace mlir::pdl;
18
19#include "mlir/Dialect/PDL/IR/PDLOpsDialect.cpp.inc"
20
21//===----------------------------------------------------------------------===//
22// PDL Operations
23//===----------------------------------------------------------------------===//
24
25/// Returns true if the given operation is used by a "binding" pdl operation.
26static bool hasBindingUse(Operation *op) {
27 for (Operation *user : op->getUsers())
28 // A result by itself is not binding, it must also be bound.
29 if (!isa<ResultOp, ResultsOp>(user) || hasBindingUse(user))
30 return true;
31 return false;
32}
33
34/// Returns success if the given operation is not in the main matcher body or
35/// is used by a "binding" operation. On failure, emits an error.
36static LogicalResult verifyHasBindingUse(Operation *op) {
37 // If the parent is not a pattern, there is nothing to do.
38 if (!llvm::isa_and_nonnull<PatternOp>(op->getParentOp()))
39 return success();
40 if (hasBindingUse(op))
41 return success();
42 return op->emitOpError(
43 "expected a bindable user when defined in the matcher body of a "
44 "`pdl.pattern`");
45}
46
47/// Visits all the pdl.operand(s), pdl.result(s), and pdl.operation(s)
48/// connected to the given operation.
49static void visit(Operation *op, DenseSet<Operation *> &visited) {
50 // If the parent is not a pattern, there is nothing to do.
51 if (!isa<PatternOp>(op->getParentOp()) || isa<RewriteOp>(op))
52 return;
53
54 // Ignore if already visited. Otherwise, mark as visited.
55 if (!visited.insert(op).second)
56 return;
57
58 // Traverse the operands / parent.
60 .Case([&visited](OperationOp operation) {
61 for (Value operand : operation.getOperandValues())
62 visit(operand.getDefiningOp(), visited);
63 })
64 .Case<ResultOp, ResultsOp>([&visited](auto result) {
65 visit(result.getParent().getDefiningOp(), visited);
66 });
67
68 // Traverse the users.
69 for (Operation *user : op->getUsers())
70 visit(user, visited);
71}
72
73//===----------------------------------------------------------------------===//
74// pdl::ApplyNativeConstraintOp
75//===----------------------------------------------------------------------===//
76
77LogicalResult ApplyNativeConstraintOp::verify() {
78 if (getNumOperands() == 0)
79 return emitOpError("expected at least one argument");
80 if (llvm::any_of(getResults(), [](OpResult result) {
81 return isa<OperationType>(result.getType());
82 })) {
83 return emitOpError(
84 "returning an operation from a constraint is not supported");
85 }
86 return success();
87}
88
89//===----------------------------------------------------------------------===//
90// pdl::ApplyNativeRewriteOp
91//===----------------------------------------------------------------------===//
92
93LogicalResult ApplyNativeRewriteOp::verify() {
94 if (getNumOperands() == 0 && getNumResults() == 0)
95 return emitOpError("expected at least one argument or result");
96 return success();
97}
98
99//===----------------------------------------------------------------------===//
100// pdl::AttributeOp
101//===----------------------------------------------------------------------===//
102
103LogicalResult AttributeOp::verify() {
104 Value attrType = getValueType();
105 std::optional<Attribute> attrValue = getValue();
106
107 if (!attrValue) {
108 if (isa<RewriteOp>((*this)->getParentOp()))
109 return emitOpError(
110 "expected constant value when specified within a `pdl.rewrite`");
111 return verifyHasBindingUse(*this);
112 }
113 if (attrType)
114 return emitOpError("expected only one of [`type`, `value`] to be set");
115 return success();
116}
117
118//===----------------------------------------------------------------------===//
119// pdl::OperandOp
120//===----------------------------------------------------------------------===//
121
122LogicalResult OperandOp::verify() { return verifyHasBindingUse(*this); }
123
124//===----------------------------------------------------------------------===//
125// pdl::OperandsOp
126//===----------------------------------------------------------------------===//
127
128LogicalResult OperandsOp::verify() { return verifyHasBindingUse(*this); }
129
130//===----------------------------------------------------------------------===//
131// pdl::OperationOp
132//===----------------------------------------------------------------------===//
133
134static ParseResult parseOperationOpAttributes(
135 OpAsmParser &p,
137 ArrayAttr &attrNamesAttr) {
138 Builder &builder = p.getBuilder();
140 if (succeeded(p.parseOptionalLBrace())) {
141 auto parseOperands = [&]() {
142 StringAttr nameAttr;
144 if (p.parseAttribute(nameAttr) || p.parseEqual() ||
145 p.parseOperand(operand))
146 return failure();
147 attrNames.push_back(nameAttr);
148 attrOperands.push_back(operand);
149 return success();
150 };
151 if (p.parseCommaSeparatedList(parseOperands) || p.parseRBrace())
152 return failure();
153 }
154 attrNamesAttr = builder.getArrayAttr(attrNames);
155 return success();
156}
157
158static void printOperationOpAttributes(OpAsmPrinter &p, OperationOp op,
159 OperandRange attrArgs,
160 ArrayAttr attrNames) {
161 if (attrNames.empty())
162 return;
163 p << " {";
164 interleaveComma(llvm::seq<int>(0, attrNames.size()), p,
165 [&](int i) { p << attrNames[i] << " = " << attrArgs[i]; });
166 p << '}';
167}
168
169/// Verifies that the result types of this operation, defined within a
170/// `pdl.rewrite`, can be inferred.
171static LogicalResult verifyResultTypesAreInferrable(OperationOp op,
172 OperandRange resultTypes) {
173 // Functor that returns if the given use can be used to infer a type.
174 Block *rewriterBlock = op->getBlock();
175 auto canInferTypeFromUse = [&](OpOperand &use) {
176 // If the use is within a ReplaceOp and isn't the operation being replaced
177 // (i.e. is not the first operand of the replacement), we can infer a type.
178 ReplaceOp replOpUser = dyn_cast<ReplaceOp>(use.getOwner());
179 if (!replOpUser || use.getOperandNumber() == 0)
180 return false;
181 // Make sure the replaced operation was defined before this one.
182 Operation *replacedOp = replOpUser.getOpValue().getDefiningOp();
183 return replacedOp->getBlock() != rewriterBlock ||
184 replacedOp->isBeforeInBlock(op);
185 };
186
187 // Check to see if the uses of the operation itself can be used to infer
188 // types.
189 if (llvm::any_of(op.getOp().getUses(), canInferTypeFromUse))
190 return success();
191
192 // Handle the case where the operation has no explicit result types.
193 if (resultTypes.empty()) {
194 // If we don't know the concrete operation, don't attempt any verification.
195 // We can't make assumptions if we don't know the concrete operation.
196 std::optional<StringRef> rawOpName = op.getOpName();
197 if (!rawOpName)
198 return success();
199 std::optional<RegisteredOperationName> opName =
200 RegisteredOperationName::lookup(*rawOpName, op.getContext());
201 if (!opName)
202 return success();
203
204 // If no explicit result types were provided, check to see if the operation
205 // expected at least one result. This doesn't cover all cases, but this
206 // should cover many cases in which the user intended to infer the results
207 // of an operation, but it isn't actually possible.
208 bool expectedAtLeastOneResult =
209 !opName->hasTrait<OpTrait::ZeroResults>() &&
210 !opName->hasTrait<OpTrait::VariadicResults>();
211 if (expectedAtLeastOneResult) {
212 return op
213 .emitOpError("must have inferable or constrained result types when "
214 "nested within `pdl.rewrite`")
215 .attachNote()
216 .append("operation is created in a non-inferrable context, but '",
217 *opName, "' does not implement InferTypeOpInterface");
218 }
219 return success();
220 }
221
222 // Otherwise, make sure each of the types can be inferred.
223 for (const auto &it : llvm::enumerate(resultTypes)) {
224 Operation *resultTypeOp = it.value().getDefiningOp();
225 assert(resultTypeOp && "expected valid result type operation");
226
227 // If the op was defined by a `apply_native_rewrite`, it is guaranteed to be
228 // usable.
229 if (isa<ApplyNativeRewriteOp>(resultTypeOp))
230 continue;
231
232 // If the type operation was defined in the matcher and constrains an
233 // operand or the result of an input operation, it can be used.
234 auto constrainsInput = [rewriterBlock](Operation *user) {
235 return user->getBlock() != rewriterBlock &&
236 isa<OperandOp, OperandsOp, OperationOp>(user);
237 };
238 if (TypeOp typeOp = dyn_cast<TypeOp>(resultTypeOp)) {
239 if (typeOp.getConstantType() ||
240 llvm::any_of(typeOp->getUsers(), constrainsInput))
241 continue;
242 } else if (TypesOp typeOp = dyn_cast<TypesOp>(resultTypeOp)) {
243 if (typeOp.getConstantTypes() ||
244 llvm::any_of(typeOp->getUsers(), constrainsInput))
245 continue;
246 }
247
248 return op
249 .emitOpError("must have inferable or constrained result types when "
250 "nested within `pdl.rewrite`")
251 .attachNote()
252 .append("result type #", it.index(), " was not constrained");
253 }
254 return success();
255}
256
257LogicalResult OperationOp::verify() {
258 bool isWithinRewrite = isa_and_nonnull<RewriteOp>((*this)->getParentOp());
259 if (isWithinRewrite && !getOpName())
260 return emitOpError("must have an operation name when nested within "
261 "a `pdl.rewrite`");
262 ArrayAttr attributeNames = getAttributeValueNamesAttr();
263 auto attributeValues = getAttributeValues();
264 if (attributeNames.size() != attributeValues.size()) {
265 return emitOpError()
266 << "expected the same number of attribute values and attribute "
267 "names, got "
268 << attributeNames.size() << " names and " << attributeValues.size()
269 << " values";
270 }
271
272 // If the operation is within a rewrite body and doesn't have type inference,
273 // ensure that the result types can be resolved.
274 if (isWithinRewrite && !mightHaveTypeInference()) {
275 if (failed(verifyResultTypesAreInferrable(*this, getTypeValues())))
276 return failure();
277 }
278
279 return verifyHasBindingUse(*this);
280}
281
282bool OperationOp::hasTypeInference() {
283 if (std::optional<StringRef> rawOpName = getOpName()) {
284 OperationName opName(*rawOpName, getContext());
285 return opName.hasInterface<InferTypeOpInterface>();
286 }
287 return false;
288}
289
290bool OperationOp::mightHaveTypeInference() {
291 if (std::optional<StringRef> rawOpName = getOpName()) {
292 OperationName opName(*rawOpName, getContext());
293 return opName.mightHaveInterface<InferTypeOpInterface>();
294 }
295 return false;
296}
297
298//===----------------------------------------------------------------------===//
299// pdl::PatternOp
300//===----------------------------------------------------------------------===//
301
302LogicalResult PatternOp::verifyRegions() {
303 Region &body = getBodyRegion();
304 Operation *term = body.front().getTerminator();
305 auto rewriteOp = dyn_cast<RewriteOp>(term);
306 if (!rewriteOp) {
307 return emitOpError("expected body to terminate with `pdl.rewrite`")
308 .attachNote(term->getLoc())
309 .append("see terminator defined here");
310 }
311
312 // Check that all values defined in the top-level pattern belong to the PDL
313 // dialect.
314 WalkResult result = body.walk([&](Operation *op) -> WalkResult {
315 if (!isa_and_nonnull<PDLDialect>(op->getDialect())) {
316 emitOpError("expected only `pdl` operations within the pattern body")
317 .attachNote(op->getLoc())
318 .append("see non-`pdl` operation defined here");
319 return WalkResult::interrupt();
320 }
321 return WalkResult::advance();
322 });
323 if (result.wasInterrupted())
324 return failure();
325
326 // Check that there is at least one operation.
327 if (body.front().getOps<OperationOp>().empty())
328 return emitOpError("the pattern must contain at least one `pdl.operation`");
329
330 // Determine if the operations within the pdl.pattern form a connected
331 // component. This is determined by starting the search from the first
332 // operand/result/operation and visiting their users / parents / operands.
333 // We limit our attention to operations that have a user in pdl.rewrite,
334 // those that do not will be detected via other means (expected bindable
335 // user).
336 bool first = true;
337 DenseSet<Operation *> visited;
338 for (Operation &op : body.front()) {
339 // The following are the operations forming the connected component.
340 if (!isa<OperandOp, OperandsOp, ResultOp, ResultsOp, OperationOp>(op))
341 continue;
342
343 // Determine if the operation has a user in `pdl.rewrite`.
344 bool hasUserInRewrite = false;
345 for (Operation *user : op.getUsers()) {
346 Region *region = user->getParentRegion();
347 if (isa<RewriteOp>(user) ||
348 (region && isa<RewriteOp>(region->getParentOp()))) {
349 hasUserInRewrite = true;
350 break;
351 }
352 }
353
354 // If the operation does not have a user in `pdl.rewrite`, ignore it.
355 if (!hasUserInRewrite)
356 continue;
357
358 if (first) {
359 // For the first operation, invoke visit.
360 visit(&op, visited);
361 first = false;
362 } else if (!visited.count(&op)) {
363 // For the subsequent operations, check if already visited.
364 return emitOpError("the operations must form a connected component")
365 .attachNote(op.getLoc())
366 .append("see a disconnected value / operation here");
367 }
368 }
369
370 return success();
371}
372
373void PatternOp::build(OpBuilder &builder, OperationState &state,
374 std::optional<uint16_t> benefit,
375 std::optional<StringRef> name) {
376 build(builder, state, builder.getI16IntegerAttr(benefit.value_or(0)),
377 name ? builder.getStringAttr(*name) : StringAttr(),
378 /*sym_visibility=*/nullptr);
379 state.regions[0]->emplaceBlock();
380}
381
382/// Returns the rewrite operation of this pattern.
383RewriteOp PatternOp::getRewriter() {
384 return cast<RewriteOp>(getBodyRegion().front().getTerminator());
385}
386
387/// The default dialect is `pdl`.
388StringRef PatternOp::getDefaultDialect() {
389 return PDLDialect::getDialectNamespace();
390}
391
392//===----------------------------------------------------------------------===//
393// pdl::RangeOp
394//===----------------------------------------------------------------------===//
395
396static ParseResult parseRangeType(OpAsmParser &p, TypeRange argumentTypes,
397 Type &resultType) {
398 // If arguments were provided, infer the result type from the argument list.
399 if (!argumentTypes.empty()) {
400 resultType = RangeType::get(getRangeElementTypeOrSelf(argumentTypes[0]));
401 return success();
402 }
403 // Otherwise, parse the type as a trailing type.
404 return p.parseColonType(resultType);
405}
406
407static void printRangeType(OpAsmPrinter &p, RangeOp op, TypeRange argumentTypes,
408 Type resultType) {
409 if (argumentTypes.empty())
410 p << ": " << resultType;
411}
412
413LogicalResult RangeOp::verify() {
414 Type elementType = getType().getElementType();
415 for (Type operandType : getOperandTypes()) {
416 Type operandElementType = getRangeElementTypeOrSelf(operandType);
417 if (operandElementType != elementType) {
418 return emitOpError("expected operand to have element type ")
419 << elementType << ", but got " << operandElementType;
420 }
421 }
422 return success();
423}
424
425//===----------------------------------------------------------------------===//
426// pdl::ReplaceOp
427//===----------------------------------------------------------------------===//
428
429LogicalResult ReplaceOp::verify() {
430 if (getReplOperation() && !getReplValues().empty())
431 return emitOpError() << "expected no replacement values to be provided"
432 " when the replacement operation is present";
433 return success();
434}
435
436//===----------------------------------------------------------------------===//
437// pdl::ResultsOp
438//===----------------------------------------------------------------------===//
439
440static ParseResult parseResultsValueType(OpAsmParser &p, IntegerAttr index,
441 Type &resultType) {
442 if (!index) {
443 resultType = RangeType::get(p.getBuilder().getType<ValueType>());
444 return success();
445 }
446 if (p.parseArrow() || p.parseType(resultType))
447 return failure();
448 return success();
449}
450
451static void printResultsValueType(OpAsmPrinter &p, ResultsOp op,
452 IntegerAttr index, Type resultType) {
453 if (index)
454 p << " -> " << resultType;
455}
456
457LogicalResult ResultsOp::verify() {
458 if (!getIndex() && llvm::isa<pdl::ValueType>(getType())) {
459 return emitOpError() << "expected `pdl.range<value>` result type when "
460 "no index is specified, but got: "
461 << getType();
462 }
463 return success();
464}
465
466//===----------------------------------------------------------------------===//
467// pdl::RewriteOp
468//===----------------------------------------------------------------------===//
469
470LogicalResult RewriteOp::verifyRegions() {
471 Region &rewriteRegion = getBodyRegion();
472
473 // Handle the case where the rewrite is external.
474 if (getName()) {
475 if (!rewriteRegion.empty()) {
476 return emitOpError()
477 << "expected rewrite region to be empty when rewrite is external";
478 }
479 return success();
480 }
481
482 // Otherwise, check that the rewrite region only contains a single block.
483 if (rewriteRegion.empty()) {
484 return emitOpError() << "expected rewrite region to be non-empty if "
485 "external name is not specified";
486 }
487
488 // Check that no additional arguments were provided.
489 if (!getExternalArgs().empty()) {
490 return emitOpError() << "expected no external arguments when the "
491 "rewrite is specified inline";
492 }
493
494 return success();
495}
496
497/// The default dialect is `pdl`.
498StringRef RewriteOp::getDefaultDialect() {
499 return PDLDialect::getDialectNamespace();
500}
501
502//===----------------------------------------------------------------------===//
503// pdl::TypeOp
504//===----------------------------------------------------------------------===//
505
506LogicalResult TypeOp::verify() {
507 if (!getConstantTypeAttr())
508 return verifyHasBindingUse(*this);
509 return success();
510}
511
512//===----------------------------------------------------------------------===//
513// pdl::TypesOp
514//===----------------------------------------------------------------------===//
515
516LogicalResult TypesOp::verify() {
517 if (!getConstantTypesAttr())
518 return verifyHasBindingUse(*this);
519 return success();
520}
521
522//===----------------------------------------------------------------------===//
523// TableGen'd op method definitions
524//===----------------------------------------------------------------------===//
525
526#define GET_OP_CLASSES
527#include "mlir/Dialect/PDL/IR/PDLOps.cpp.inc"
return success()
static ParseResult parseResultsValueType(OpAsmParser &p, IntegerAttr index, Type &resultType)
Definition PDL.cpp:440
static LogicalResult verifyHasBindingUse(Operation *op)
Returns success if the given operation is not in the main matcher body or is used by a "binding" oper...
Definition PDL.cpp:36
static void visit(Operation *op, DenseSet< Operation * > &visited)
Visits all the pdl.operand(s), pdl.result(s), and pdl.operation(s) connected to the given operation.
Definition PDL.cpp:49
static LogicalResult verifyResultTypesAreInferrable(OperationOp op, OperandRange resultTypes)
Verifies that the result types of this operation, defined within a pdl.rewrite, can be inferred.
Definition PDL.cpp:171
static void printRangeType(OpAsmPrinter &p, RangeOp op, TypeRange argumentTypes, Type resultType)
Definition PDL.cpp:407
static ParseResult parseRangeType(OpAsmParser &p, TypeRange argumentTypes, Type &resultType)
Definition PDL.cpp:396
static ParseResult parseOperationOpAttributes(OpAsmParser &p, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &attrOperands, ArrayAttr &attrNamesAttr)
Definition PDL.cpp:134
static bool hasBindingUse(Operation *op)
Returns true if the given operation is used by a "binding" pdl operation.
Definition PDL.cpp:26
static void printOperationOpAttributes(OpAsmPrinter &p, OperationOp op, OperandRange attrArgs, ArrayAttr attrNames)
Definition PDL.cpp:158
static void printResultsValueType(OpAsmPrinter &p, ResultsOp op, IntegerAttr index, Type resultType)
Definition PDL.cpp:451
ArrayAttr()
b getContext())
static Type getValueType(Attribute attr)
Definition SPIRVOps.cpp:846
virtual Builder & getBuilder() const =0
Return a builder which provides useful access to MLIRContext, global objects like types and attribute...
virtual ParseResult parseCommaSeparatedList(Delimiter delimiter, function_ref< ParseResult()> parseElementFn, StringRef contextMessage=StringRef())=0
Parse a list of comma-separated items with an optional delimiter.
virtual ParseResult parseRBrace()=0
Parse a } token.
virtual ParseResult parseEqual()=0
Parse a = token.
virtual ParseResult parseColonType(Type &result)=0
Parse a colon followed by a type.
virtual ParseResult parseArrow()=0
Parse a '->' token.
virtual ParseResult parseType(Type &result)=0
Parse a type.
virtual ParseResult parseAttribute(Attribute &result, Type type={})=0
Parse an arbitrary attribute of a given type and return it in result.
virtual ParseResult parseOptionalLBrace()=0
Parse a { token if present.
Block represents an ordered list of Operations.
Definition Block.h:34
Operation * getTerminator()
Get the terminator operation of this block.
Definition Block.cpp:249
auto getOps()
Return an iterator range over the operations within this block that are of 'OpT'.
Definition Block.h:213
This class is a general helper class for creating context-global objects like types,...
Definition Builders.h:51
IntegerAttr getI16IntegerAttr(int16_t value)
Definition Builders.cpp:225
Ty getType(Args &&...args)
Get or construct an instance of the type Ty with provided arguments.
Definition Builders.h:94
StringAttr getStringAttr(const Twine &bytes)
Definition Builders.cpp:271
ArrayAttr getArrayAttr(ArrayRef< Attribute > value)
Definition Builders.cpp:275
The OpAsmParser has methods for interacting with the asm parser: parsing things from it,...
virtual ParseResult parseOperand(UnresolvedOperand &result, bool allowResultNumber=true)=0
Parse a single SSA value operand name along with a result number if allowResultNumber is true.
This is a pure-virtual base class that exposes the asmprinter hooks necessary to implement a custom p...
This class represents an operand of an operation.
Definition Value.h:256
This is a value defined by a result of an operation.
Definition Value.h:456
This class provides the API for ops which have an unknown number of results.
This class provides return value APIs for ops that are known to have zero results.
This class implements the operand iterators for the Operation class.
Definition ValueRange.h:44
Operation is the basic unit of execution within MLIR.
Definition Operation.h:87
Dialect * getDialect()
Return the dialect this operation is associated with, or nullptr if the associated dialect is not loa...
Definition Operation.h:237
bool isBeforeInBlock(Operation *other)
Given an operation 'other' that is within the same parent block, return whether the current operation...
Block * getBlock()
Returns the operation block that contains this operation.
Definition Operation.h:230
Location getLoc()
The source location the operation was defined or derived from.
Definition Operation.h:240
Operation * getParentOp()
Returns the closest surrounding operation that contains this operation or nullptr if this is a top-le...
Definition Operation.h:251
user_range getUsers()
Returns a range of all users.
Definition Operation.h:927
InFlightDiagnostic emitOpError(const Twine &message={})
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers.
Block & front()
Definition Region.h:65
bool empty()
Definition Region.h:60
Operation * getParentOp()
Return the parent operation this region is attached to.
Definition Region.h:198
RetT walk(FnT &&callback)
Walk all nested operations, blocks or regions (including this region), depending on the type of callb...
Definition Region.h:297
static std::optional< RegisteredOperationName > lookup(StringRef name, MLIRContext *ctx)
Lookup the registered operation information for the given operation.
This class provides an abstraction over the various different ranges of value types.
Definition TypeRange.h:40
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Definition Types.h:74
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
static WalkResult advance()
Definition WalkResult.h:47
static WalkResult interrupt()
Definition WalkResult.h:46
Type getRangeElementTypeOrSelf(Type type)
If the given type is a range, return its element type, otherwise return the type itself.
Definition PDLTypes.cpp:48
DynamicAPInt getIndex(const ConeV &cone)
Get the index of a cone, i.e., the volume of the parallelepiped spanned by its generators,...
Definition Barvinok.cpp:63
detail::InFlightRemark failed(Location loc, RemarkOpts opts)
Report an optimization remark that failed.
Definition Remarks.h:886
Include the generated interface declarations.
Type getType(OpFoldResult ofr)
Returns the int type of the integer in ofr.
Definition Utils.cpp:311
llvm::DenseSet< ValueT, ValueInfoT > DenseSet
Definition LLVM.h:125
llvm::TypeSwitch< T, ResultT > TypeSwitch
Definition LLVM.h:147
This is the representation of an operand reference.
SmallVector< std::unique_ptr< Region >, 1 > regions
Regions that the op will hold.