23 template <
typename OpTy>
28 matchAndRewrite(OpTy op,
typename OpTy::Adaptor adaptor,
34 op, [&]() { op->
setOperands(adaptor.getOperands()); });
45 ScalableMaskedAddIIntrOp>;
48 ScalableMaskedAddFIntrOp>;
51 ScalableMaskedSubIIntrOp>;
54 ScalableMaskedSubFIntrOp>;
57 ScalableMaskedMulIIntrOp>;
60 ScalableMaskedMulFIntrOp>;
63 ScalableMaskedSDivIIntrOp>;
66 ScalableMaskedUDivIIntrOp>;
69 ScalableMaskedDivFIntrOp>;
92 template <
typename Op,
typename IntrOp>
97 matchAndRewrite(
Op convertOp,
typename Op::Adaptor,
99 auto loc = convertOp.
getLoc();
101 auto source = convertOp.getSource();
102 VectorType sourceType = source.getType();
103 VectorType resultType = convertOp.getResult().getType();
106 loc, resultType, rewriter.
getZeroAttr(resultType));
112 tileShape.back() = sourceType.getShape().back();
117 auto extractOrInsertPosition =
ArrayRef(index).drop_back();
118 auto sourceVector = rewriter.
create<vector::ExtractOp>(
119 loc, source, extractOrInsertPosition);
120 VectorType convertedType =
122 .
setDim(0, resultType.getShape().back());
123 auto convertedVector =
125 result = rewriter.
create<vector::InsertOp>(loc, convertedVector, result,
126 extractOrInsertPosition);
134 using ConvertToSvboolOpLowering =
135 SvboolConversionOpLowering<ConvertToSvboolOp, ConvertToSvboolIntrOp>;
137 using ConvertFromSvboolOpLowering =
138 SvboolConversionOpLowering<ConvertFromSvboolOp, ConvertFromSvboolIntrOp>;
165 ConvertToSvboolOpLowering,
166 ConvertFromSvboolOpLowering>(converter);
177 ScalableMaskedAddIIntrOp,
178 ScalableMaskedAddFIntrOp,
179 ScalableMaskedSubIIntrOp,
180 ScalableMaskedSubFIntrOp,
181 ScalableMaskedMulIIntrOp,
182 ScalableMaskedMulFIntrOp,
183 ScalableMaskedSDivIIntrOp,
184 ScalableMaskedUDivIIntrOp,
185 ScalableMaskedDivFIntrOp,
186 ConvertToSvboolIntrOp,
187 ConvertFromSvboolIntrOp>();
192 ScalableMaskedAddIOp,
193 ScalableMaskedAddFOp,
194 ScalableMaskedSubIOp,
195 ScalableMaskedSubFOp,
196 ScalableMaskedMulIOp,
197 ScalableMaskedMulFOp,
198 ScalableMaskedSDivIOp,
199 ScalableMaskedUDivIOp,
200 ScalableMaskedDivFOp,
202 ConvertFromSvboolOp>();
TypedAttr getZeroAttr(Type type)
This class implements a pattern rewriter for use with ConversionPatterns.
void replaceOp(Operation *op, ValueRange newValues) override
PatternRewriter hook for replacing an operation.
LogicalResult notifyMatchFailure(Location loc, function_ref< void(Diagnostic &)> reasonCallback) override
PatternRewriter hook for notifying match failure reasons.
void addLegalOp(OperationName op)
Register the given operations as legal.
void addIllegalOp(OperationName op)
Register the given operation as illegal, i.e.
Utility class for operation conversions targeting the LLVM dialect that match exactly one source oper...
Derived class that automatically populates legalization information for different LLVM ops.
Conversion from types to the LLVM IR dialect.
MLIRContext & getContext() const
Returns the MLIR context.
Generic implementation of one-to-one conversion from "SourceOp" to "TargetOp" where the latter belong...
Operation * create(const OperationState &state)
Creates an operation given the fields represented as an OperationState.
OpConversionPattern is a wrapper around ConversionPattern that allows for matching and rewriting agai...
Location getLoc()
The source location the operation was defined or derived from.
This provides public APIs that all operations should have.
type_range getTypes() const
operand_range getOperands()
Returns an iterator on the underlying Value's.
void setOperands(ValueRange operands)
Replace the current operands of this operation with the ones provided in 'operands'.
RewritePatternSet & add(ConstructorArg &&arg, ConstructorArgs &&...args)
Add an instance of each of the pattern types 'Ts' to the pattern list with the given arguments.
void updateRootInPlace(Operation *root, CallableT &&callable)
This method is a utility wrapper around a root update of an operation.
A range-style iterator that allows for iterating over the offsets of all potential tiles of size tile...
This class provides an abstraction over the various different ranges of value types.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
This is a builder type that keeps local references to arguments.
Builder & setDim(unsigned pos, int64_t val)
Set a dim in shape @pos to val.
Include the generated interface declarations.
void configureArmSVELegalizeForExportTarget(LLVMConversionTarget &target)
Configure the target to support lowering ArmSVE ops to ops that map to LLVM intrinsics.
LogicalResult success(bool isSuccess=true)
Utility function to generate a LogicalResult.
void populateArmSVELegalizeForLLVMExportPatterns(LLVMTypeConverter &converter, RewritePatternSet &patterns)
Collect a set of patterns to lower ArmSVE ops to ops that map to LLVM intrinsics.
This class represents an efficient way to signal success or failure.