| 1 | //===- ArmSVEVectorTransformOps.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/ArmSVE/TransformOps/ArmSVEVectorTransformOps.h" |
| 10 | |
| 11 | #include "mlir/Dialect/ArmSVE/IR/ArmSVEDialect.h" |
| 12 | #include "mlir/Dialect/ArmSVE/Transforms/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::ApplyArmSVELowerContractionToI8MMPatternsOp::populatePatterns( |
| 22 | RewritePatternSet &patterns) { |
| 23 | arm_sve::populateLowerContractionToSVEI8MMPatterns(patterns); |
| 24 | } |
| 25 | |
| 26 | void transform::ApplyArmSVELowerContractionToBFMMLAPatternsOp::populatePatterns( |
| 27 | RewritePatternSet &patterns) { |
| 28 | arm_sve::populateLowerContractionToSVEBFMMLAPatterns(patterns); |
| 29 | } |
| 30 | |
| 31 | void transform::ApplyArmSVELowerContractionToIndexedFMLAPatternsOp:: |
| 32 | populatePatterns(RewritePatternSet &patterns) { |
| 33 | arm_sve::populateLowerContractionToSVEIndexedFMLAPatterns(patterns); |
| 34 | } |
| 35 | |
| 36 | //===----------------------------------------------------------------------===// |
| 37 | // Transform op registration |
| 38 | //===----------------------------------------------------------------------===// |
| 39 | |
| 40 | namespace { |
| 41 | class ArmSVEVectorTransformDialectExtension |
| 42 | : public transform::TransformDialectExtension< |
| 43 | ArmSVEVectorTransformDialectExtension> { |
| 44 | public: |
| 45 | MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID( |
| 46 | ArmSVEVectorTransformDialectExtension) |
| 47 | |
| 48 | ArmSVEVectorTransformDialectExtension() { |
| 49 | declareGeneratedDialect<arm_sve::ArmSVEDialect>(); |
| 50 | registerTransformOps< |
| 51 | #define GET_OP_LIST |
| 52 | #include "mlir/Dialect/ArmSVE/TransformOps/ArmSVEVectorTransformOps.cpp.inc" |
| 53 | >(); |
| 54 | } |
| 55 | }; |
| 56 | } // namespace |
| 57 | |
| 58 | #define GET_OP_CLASSES |
| 59 | #include "mlir/Dialect/ArmSVE/TransformOps/ArmSVEVectorTransformOps.cpp.inc" |
| 60 | |
| 61 | void mlir::arm_sve::registerTransformDialectExtension( |
| 62 | DialectRegistry ®istry) { |
| 63 | registry.addExtensions<ArmSVEVectorTransformDialectExtension>(); |
| 64 | } |
| 65 |