9#ifndef MLIR_CONVERSION_LLVMCOMMON_VECTORPATTERN_H
10#define MLIR_CONVERSION_LLVMCOMMON_VECTORPATTERN_H
45 unsigned linearIndex);
55 ConversionPatternRewriter &rewriter);
62 ConversionPatternRewriter &rewriter);
70template <
typename SourceOp,
typename TargetOp>
91template <
typename SourceOp,
typename TargetOp,
92 template <
typename,
typename>
typename AttrConvert =
93 AttrConvertPassThrough,
94 bool FailOnUnsupportedFP =
false>
104 ConversionPatternRewriter &rewriter)
const override {
106 std::is_base_of<OpTrait::OneResult<SourceOp>, SourceOp>::value,
107 "expected single result op");
112 op, *this->typeConverter)) {
113 return rewriter.notifyMatchFailure(op,
"unsupported floating point type");
117 AttrConvert<SourceOp, TargetOp> attrConvert(op);
120 op, TargetOp::getOperationName(), adaptor.getOperands(),
121 attrConvert.getAttrs(), attrConvert.getPropAttr(),
122 *this->getTypeConverter(), rewriter);
AttrConvertPassThrough(SourceOp srcOp)
ArrayRef< NamedAttribute > getAttrs() const
Attribute getPropAttr() const
Attributes are known-constant values of operations.
ConvertOpToLLVMPattern(const LLVMTypeConverter &typeConverter, PatternBenefit benefit=1)
Conversion from types to the LLVM IR dialect.
This class helps build Operations.
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 provides an abstraction over the different types of ranges over Values.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Basic lowering implementation to rewrite Ops with just one result to the LLVM Dialect.
VectorConvertToLLVMPattern< SourceOp, TargetOp > Super
LogicalResult matchAndRewrite(SourceOp op, typename SourceOp::Adaptor adaptor, ConversionPatternRewriter &rewriter) const override
LogicalResult vectorOneToOneRewrite(Operation *op, StringRef targetOp, ValueRange operands, ArrayRef< NamedAttribute > targetAttrs, Attribute propertiesAttr, const LLVMTypeConverter &typeConverter, ConversionPatternRewriter &rewriter)
LogicalResult handleMultidimensionalVectors(Operation *op, ValueRange operands, const LLVMTypeConverter &typeConverter, std::function< Value(Type, ValueRange)> createOperand, ConversionPatternRewriter &rewriter)
void nDVectorIterate(const NDVectorTypeInfo &info, OpBuilder &builder, function_ref< void(ArrayRef< int64_t >)> fun)
bool opHasUnsupportedFloatingPointTypes(Operation *op, const TypeConverter &typeConverter)
Return "true" if the given op has any unsupported floating point types (either operands or results).
NDVectorTypeInfo extractNDVectorTypeInfo(VectorType vectorType, const LLVMTypeConverter &converter)
SmallVector< int64_t, 4 > getCoordinates(ArrayRef< int64_t > basis, unsigned linearIndex)
Include the generated interface declarations.
llvm::function_ref< Fn > function_ref
SmallVector< int64_t, 4 > arraySizes