18#define GEN_PASS_DEF_CONVERTARMNEON2DTOINTRPASS
19#include "mlir/Conversion/Passes.h.inc"
33 LogicalResult matchAndRewrite(Sdot2dOp op,
34 PatternRewriter &rewriter)
const override {
35 Type elemType = cast<VectorType>(op.getB().getType()).getElementType();
36 int length = cast<VectorType>(op.getB().getType()).getShape()[0] *
37 Sdot2dOp::kReductionSize;
38 VectorType flattenedVectorType = VectorType::get({length}, elemType);
39 Value b2d = op.getB();
40 Value c2d = op.getC();
41 Location loc = op.getLoc();
43 vector::ShapeCastOp::create(rewriter, loc, flattenedVectorType, b2d);
45 vector::ShapeCastOp::create(rewriter, loc, flattenedVectorType, c2d);
46 Value newOp = SdotOp::create(rewriter, loc, op.getRes().getType(),
53class ConvertArmNeon2dToIntr
55 void runOnOperation()
override {
62 return signalPassFailure();
virtual void replaceOp(Operation *op, ValueRange newValues)
Replace the results of the given (original) operation with the specified list of values (replacements...
Include the generated interface declarations.
LogicalResult applyPatternsGreedily(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...
void populateConvertArmNeon2dToIntrPatterns(RewritePatternSet &patterns)
Populates patterns for the lowering of Arm NEON 2D ops to intrinsics.
const FrozenRewritePatternSet & patterns
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...