//===- ArithToArmSME.cpp - Arith to ArmSME dialect conversion -------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "mlir/Conversion/ArithToArmSME/ArithToArmSME.h" #include "mlir/Dialect/Arith/IR/Arith.h" #include "mlir/Dialect/ArmSME/IR/ArmSME.h" #include "mlir/Dialect/ArmSME/Utils/Utils.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" namespace mlir { #define GEN_PASS_DEF_ARITHTOARMSMECONVERSIONPASS #include "mlir/Conversion/Passes.h.inc" } // namespace mlir #define DEBUG_TYPE … usingnamespacemlir; //===----------------------------------------------------------------------===// // Conversion helpers //===----------------------------------------------------------------------===// /// Returns true if 'val' is a splat of zero, false otherwise. static bool isSplatZero(Type elemType, DenseElementsAttr val) { … } namespace { //===----------------------------------------------------------------------===// // ConstantOp //===----------------------------------------------------------------------===// /// Conversion pattern for dense arith.constant. struct ConstantOpToArmSMELowering : public OpRewritePattern<arith::ConstantOp> { … }; } // namespace //===----------------------------------------------------------------------===// // Pattern population //===----------------------------------------------------------------------===// void mlir::arith::populateArithToArmSMEConversionPatterns( RewritePatternSet &patterns) { … } //===----------------------------------------------------------------------===// // Pass definition //===----------------------------------------------------------------------===// namespace { struct ArithToArmSMEConversionPass final : impl::ArithToArmSMEConversionPassBase<ArithToArmSMEConversionPass> { … }; } // namespace