25 if (!isa<AttrT>(iter))
26 return op->
emitOpError(
"expected op to return array of ")
27 << AttrT::getMnemonic() <<
" attributes";
36 auto iface = cast<AccessGroupOpInterface>(op);
37 ArrayAttr accessGroups = iface.getAccessGroupsOrNull();
50 auto iface = cast<AliasAnalysisOpInterface>(op);
52 if (
auto aliasScopes = iface.getAliasScopesOrNull())
56 if (
auto noAliasScopes = iface.getNoAliasScopesOrNull())
60 ArrayAttr tags = iface.getTBAATagsOrNull();
73 auto iface = cast<DereferenceableOpInterface>(op);
75 if (
auto derefAttr = iface.getDereferenceableOrNull())
79 "expected op to return a single LLVM pointer type");
89 auto iface = cast<RangeOpInterface>(op);
91 ConstantRangeAttr range = iface.getRangeOrNull();
95 return op->
emitOpError(
"expected op to have a single result");
98 if (!intType || intType.getWidth() != range.getLower().getBitWidth())
100 "expected range bitwidth to match the integer (element) result type");
101 if (range.getLower() == range.getUpper())
102 return op->
emitOpError(
"expected range to be neither empty nor full");
123 return {getDst(), getSrc()};
127 return {getDst(), getSrc()};
131 return {getDst(), getSrc()};
164 if (!getCallee().has_value() && !operands.empty())
165 operands = operands.drop_front();
166 return llvm::filter_to_vector(
167 operands, [](
Value arg) {
return isa<LLVMPointerType>(arg.
getType()); });
170#include "mlir/Dialect/LLVMIR/LLVMInterfaces.cpp.inc"
static LogicalResult isArrayOf(Operation *op, ArrayAttr array)
Verifies that all elements of array are instances of Attr.
Attributes are known-constant values of operations.
Operation is the basic unit of execution within MLIR.
OpResult getResult(unsigned idx)
Get the 'idx'th result of this operation.
OperandRange operand_range
InFlightDiagnostic emitOpError(const Twine &message={})
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers.
unsigned getNumResults()
Return the number of results held by this operation.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Type getType() const
Return the type of this value.
LogicalResult verifyAliasAnalysisOpInterface(Operation *op)
Verifies the alias analysis attributes of memory operations that implement the alias analysis interfa...
LogicalResult verifyRangeOpInterface(Operation *op)
Verifies that the range of an operation implementing the range interface matches the bitwidth of its ...
LogicalResult verifyAccessGroupOpInterface(Operation *op)
Verifies the access groups attribute of memory operations that implement the access group interface.
LogicalResult verifyDereferenceableOpInterface(Operation *op)
Verifies that the operation implementing the dereferenceable interface has exactly one result of LLVM...
Include the generated interface declarations.
Type getElementTypeOrSelf(Type type)
Return the element type or return the type itself.