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();
72 auto iface = cast<TBAAStructOpInterface>(op);
73 ArrayAttr fields = iface.getTBAAStructOrNull();
82 std::optional<uint64_t> prevOffset;
84 uint64_t offset = cast<TBAAStructFieldAttr>(field).getOffset();
85 if (prevOffset && offset < *prevOffset)
87 "tbaa.struct field offsets must be non-decreasing");
99 auto iface = cast<DereferenceableOpInterface>(op);
101 if (
auto derefAttr = iface.getDereferenceableOrNull())
105 "expected op to return a single LLVM pointer type");
115 auto iface = cast<RangeOpInterface>(op);
117 ConstantRangeAttr range = iface.getRangeOrNull();
121 return op->
emitOpError(
"expected op to have a single result");
124 if (!intType || intType.getWidth() != range.getLower().getBitWidth())
126 "expected range bitwidth to match the integer (element) result type");
127 if (range.getLower() == range.getUpper())
128 return op->
emitOpError(
"expected range to be neither empty nor full");
149 return {getDst(), getSrc()};
153 return {getDst(), getSrc()};
157 return {getDst(), getSrc()};
190 if (!getCallee().has_value() && !operands.empty())
191 operands = operands.drop_front();
192 return llvm::filter_to_vector(
193 operands, [](
Value arg) {
return isa<LLVMPointerType>(arg.
getType()); });
196#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 verifyTBAAStructOpInterface(Operation *op)
Verifies that the tbaa.struct field offsets of memory operations that implement the tbaa....
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.