18#include "llvm/ADT/STLExtras.h"
30 auto containerType = v1.
getType();
34 build(builder, state, vType, v1, v2, mask);
49 "expected an LLVM compatible vector type");
61LogicalResult ShuffleVectorOp::verify() {
63 llvm::any_of(getMask(), [](int32_t v) {
return v != 0; }))
64 return emitOpError(
"expected a splat operation for scalable vectors");
72 auto vecType = llvm::dyn_cast<VectorType>(getV1().
getType());
73 if (!vecType || vecType.getRank() != 1 || vecType.getNumElements() != 1)
77 if (getMask().size() != 1 || getMask()[0] != 0)
83#include "mlir/Dialect/LLVMIR/LLVMVectorOps.cpp.inc"
static Type getElementType(Type type, ArrayRef< int32_t > indices, function_ref< InFlightDiagnostic(StringRef)> emitErrorFn)
Walks the given type hierarchy with the given indices, potentially down to component granularity,...
This base class exposes generic asm parser hooks, usable across the various derived parsers.
virtual InFlightDiagnostic emitError(SMLoc loc, const Twine &message={})=0
Emit a diagnostic at the specified location and return failure.
virtual SMLoc getCurrentLocation()=0
Get the location of the next token and store it into the argument.
This base class exposes generic asm printer hooks, usable across the various derived printers.
DenseI32ArrayAttr getDenseI32ArrayAttr(ArrayRef< int32_t > values)
This class helps build Operations.
This class represents a single result from folding an operation.
Operation is the basic unit of execution within MLIR.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
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.
Type getVectorType(Type elementType, unsigned numElements, bool isScalable=false)
Creates an LLVM dialect-compatible vector type with the given element type and length.
bool isScalableVectorType(Type vectorType)
Returns whether a vector type is scalable or not.
bool isCompatibleVectorType(Type type)
Returns true if the given type is a vector type compatible with the LLVM dialect.
mlir::ParseResult parseShuffleType(mlir::AsmParser &parser, mlir::Type v1Type, mlir::Type &resType, mlir::DenseI32ArrayAttr mask)
Build the result type of a shuffle vector operation.
void printShuffleType(mlir::AsmPrinter &printer, mlir::Operation *op, mlir::Type v1Type, mlir::Type resType, mlir::DenseI32ArrayAttr mask)
Nothing to do when the result type is inferred.
Include the generated interface declarations.
Type getType(OpFoldResult ofr)
Returns the int type of the integer in ofr.
detail::DenseArrayAttrImpl< int32_t > DenseI32ArrayAttr
This represents an operation in an abstracted form, suitable for use with the builder APIs.
void addAttributes(ArrayRef< NamedAttribute > newAttributes)
Add an array of named attributes.