Fix GCC build problem with 288f05f related to SmallVector. (#116958)
[llvm-project.git] / mlir / lib / Conversion / ShapeToStandard / ShapeToStandard.td
blobc2751a0a3262d8ceb12805732c3a30166cb688cf
1 //==-- ShapeToStandard.td - Shape to Standard Patterns -------*- tablegen -*==//
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 // Defines Patterns to lower Shape ops to Std.
11 //===----------------------------------------------------------------------===//
13 #ifndef MLIR_CONVERSION_SHAPETOSTANDARD_TD
14 #define MLIR_CONVERSION_SHAPETOSTANDARD_TD
16 include "mlir/IR/PatternBase.td"
17 include "mlir/Dialect/Shape/IR/ShapeOps.td"
19 def BroadcastableStringAttr : NativeCodeCall<[{
20   $_builder.getStringAttr("required broadcastable shapes")
21 }]>;
23 def CstrBroadcastableToRequire : Pat<(Shape_CstrBroadcastableOp $shapes),
24             (Shape_CstrRequireOp
25               (Shape_IsBroadcastableOp $shapes),
26               (BroadcastableStringAttr))>;
28 def EqStringAttr : NativeCodeCall<[{
29   $_builder.getStringAttr("required equal shapes")
30 }]>;
32 def CstrEqToRequire : Pat<(Shape_CstrEqOp $shapes),
33   (Shape_CstrRequireOp (Shape_ShapeEqOp $shapes), (EqStringAttr))>;
35 #endif // MLIR_CONVERSION_SHAPETOSTANDARD_TD