[mlir] Simplify DDR matching patterns with equal operands for operators.
This https://reviews.llvm.org/D89254 diff introduced implicit matching between same name arguments. Modify usages accordingly. PiperOrigin-RevId: 338090110
This commit is contained in:
parent
33c450e4cb
commit
ae00ae487c
|
@ -18,15 +18,13 @@ limitations under the License.
|
||||||
include "mlir/Dialect/Shape/IR/ShapeOps.td"
|
include "mlir/Dialect/Shape/IR/ShapeOps.td"
|
||||||
include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.td"
|
include "mlir-hlo/Dialect/mhlo/IR/hlo_ops.td"
|
||||||
|
|
||||||
def EqualBinaryOperands : Constraint<CPred<"$0 == $1">>;
|
|
||||||
|
|
||||||
// Canonicalization patterns.
|
// Canonicalization patterns.
|
||||||
|
|
||||||
def DynamicBroadcastToOwnShape_1 : Pat<
|
def DynamicBroadcastToOwnShape_1 : Pat<
|
||||||
(HLO_DynamicBroadcastInDimOp:$op $arg0,
|
(HLO_DynamicBroadcastInDimOp:$op $x,
|
||||||
(Shape_ToExtentTensorOp (Shape_ShapeOfOp $arg1)), $attr),
|
(Shape_ToExtentTensorOp (Shape_ShapeOfOp $x)), $attr),
|
||||||
(replaceWithValue $arg0), [(EqualBinaryOperands $arg0, $arg1)]>;
|
(replaceWithValue $x)>;
|
||||||
def DynamicBroadcastToOwnShape_2 : Pat<
|
def DynamicBroadcastToOwnShape_2 : Pat<
|
||||||
(HLO_DynamicBroadcastInDimOp:$op $arg0, (Shape_ShapeOfOp $arg1), $attr),
|
(HLO_DynamicBroadcastInDimOp:$op $x, (Shape_ShapeOfOp $x), $attr),
|
||||||
(replaceWithValue $arg0), [(EqualBinaryOperands $arg0, $arg1)]>;
|
(replaceWithValue $x)>;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue