19 #define GEN_PASS_DEF_CONVERTARMNEON2DTOINTR
20 #include "mlir/Conversion/Passes.h.inc"
34 LogicalResult matchAndRewrite(Sdot2dOp op,
36 Type elemType = cast<VectorType>(op.getB().getType()).getElementType();
37 int length = cast<VectorType>(op.getB().getType()).getShape()[0] *
38 Sdot2dOp::kReductionSize;
40 Value b2d = op.getB();
41 Value c2d = op.getC();
44 rewriter.
create<vector::ShapeCastOp>(loc, flattenedVectorType, b2d);
46 rewriter.
create<vector::ShapeCastOp>(loc, flattenedVectorType, c2d);
47 Value newOp = rewriter.
create<SdotOp>(loc, op.getRes().getType(), op.getA(),
54 class ConvertArmNeon2dToIntr
55 :
public impl::ConvertArmNeon2dToIntrBase<ConvertArmNeon2dToIntr> {
56 void runOnOperation()
override {
64 return signalPassFailure();
75 return std::make_unique<ConvertArmNeon2dToIntr>();
static MLIRContext * getContext(OpFoldResult val)
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Operation * create(const OperationState &state)
Creates an operation given the fields represented as an OperationState.
A special type of RewriterBase that coordinates the application of a rewrite pattern on the current I...
MLIRContext * getContext() const
RewritePatternSet & add(ConstructorArg &&arg, ConstructorArgs &&...args)
Add an instance of each of the pattern types 'Ts' to the pattern list with the given arguments.
virtual void replaceOp(Operation *op, ValueRange newValues)
Replace the results of the given (original) operation with the specified list of values (replacements...
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...
Include the generated interface declarations.
void populateConvertArmNeon2dToIntrPatterns(RewritePatternSet &patterns)
Populates patterns for the lowering of Arm NEON 2D ops to intrinsics.
std::unique_ptr< Pass > createConvertArmNeon2dToIntrPass()
Creates a pass to lower Arm NEON 2D ops to intrinsics, i.e.
LogicalResult applyPatternsAndFoldGreedily(Region ®ion, const FrozenRewritePatternSet &patterns, GreedyRewriteConfig config=GreedyRewriteConfig(), bool *changed=nullptr)
Rewrite ops in the given region, which must be isolated from above, by repeatedly applying the highes...
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...
OpRewritePattern is a wrapper around RewritePattern that allows for matching and rewriting against an...
OpRewritePattern(MLIRContext *context, PatternBenefit benefit=1, ArrayRef< StringRef > generatedNames={})
Patterns must specify the root operation name they match against, and can also specify the benefit of...