| 1 | //===- ArmNeonVectorTransformOps.cpp - Implementation transform ops -------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include "mlir/Dialect/ArmNeon/TransformOps/ArmNeonVectorTransformOps.h" |
| 10 | |
| 11 | #include "mlir/Dialect/ArmNeon/ArmNeonDialect.h" |
| 12 | #include "mlir/Dialect/ArmNeon/Transforms.h" |
| 13 | #include "mlir/Dialect/Transform/IR/TransformDialect.h" |
| 14 | |
| 15 | using namespace mlir; |
| 16 | |
| 17 | //===----------------------------------------------------------------------===// |
| 18 | // Apply...PatternsOp |
| 19 | //===----------------------------------------------------------------------===// |
| 20 | |
| 21 | void transform::ApplyArmNeonContractionToI8MMPatternsOp::populatePatterns( |
| 22 | RewritePatternSet &patterns) { |
| 23 | arm_neon::populateLowerContractionToSMMLAPatternPatterns(patterns); |
| 24 | } |
| 25 | |
| 26 | //===----------------------------------------------------------------------===// |
| 27 | // Transform op registration |
| 28 | //===----------------------------------------------------------------------===// |
| 29 | |
| 30 | namespace { |
| 31 | class ArmNeonVectorTransformDialectExtension |
| 32 | : public transform::TransformDialectExtension< |
| 33 | ArmNeonVectorTransformDialectExtension> { |
| 34 | public: |
| 35 | MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID( |
| 36 | ArmNeonVectorTransformDialectExtension) |
| 37 | |
| 38 | ArmNeonVectorTransformDialectExtension() { |
| 39 | declareGeneratedDialect<arm_neon::ArmNeonDialect>(); |
| 40 | registerTransformOps< |
| 41 | #define GET_OP_LIST |
| 42 | #include "mlir/Dialect/ArmNeon/TransformOps/ArmNeonVectorTransformOps.cpp.inc" |
| 43 | >(); |
| 44 | } |
| 45 | }; |
| 46 | } // namespace |
| 47 | |
| 48 | #define GET_OP_CLASSES |
| 49 | #include "mlir/Dialect/ArmNeon/TransformOps/ArmNeonVectorTransformOps.cpp.inc" |
| 50 | |
| 51 | void mlir::arm_neon::registerTransformDialectExtension( |
| 52 | DialectRegistry ®istry) { |
| 53 | registry.addExtensions<ArmNeonVectorTransformDialectExtension>(); |
| 54 | } |
| 55 | |