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. 10// 11//===----------------------------------------------------------------------===// 12 13#ifndef MLIR_CONVERSION_SHAPETOSTANDARD_TD 14#define MLIR_CONVERSION_SHAPETOSTANDARD_TD 15 16include "mlir/Dialect/Shape/IR/ShapeOps.td" 17 18def BroadcastableStringAttr : NativeCodeCall<[{ 19 $_builder.getStringAttr("required broadcastable shapes") 20}]>; 21 22def : Pat<(Shape_CstrBroadcastableOp $LHS, $RHS), 23 (Shape_CstrRequireOp 24 (Shape_IsBroadcastableOp $LHS, $RHS), 25 (BroadcastableStringAttr))>; 26 27#endif // MLIR_CONVERSION_SHAPETOSTANDARD_TD 28