[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-hlo/Dialect/mhlo/IR/hlo_ops.td"
|
||||
|
||||
def EqualBinaryOperands : Constraint<CPred<"$0 == $1">>;
|
||||
|
||||
// Canonicalization patterns.
|
||||
|
||||
def DynamicBroadcastToOwnShape_1 : Pat<
|
||||
(HLO_DynamicBroadcastInDimOp:$op $arg0,
|
||||
(Shape_ToExtentTensorOp (Shape_ShapeOfOp $arg1)), $attr),
|
||||
(replaceWithValue $arg0), [(EqualBinaryOperands $arg0, $arg1)]>;
|
||||
(HLO_DynamicBroadcastInDimOp:$op $x,
|
||||
(Shape_ToExtentTensorOp (Shape_ShapeOfOp $x)), $attr),
|
||||
(replaceWithValue $x)>;
|
||||
def DynamicBroadcastToOwnShape_2 : Pat<
|
||||
(HLO_DynamicBroadcastInDimOp:$op $arg0, (Shape_ShapeOfOp $arg1), $attr),
|
||||
(replaceWithValue $arg0), [(EqualBinaryOperands $arg0, $arg1)]>;
|
||||
(HLO_DynamicBroadcastInDimOp:$op $x, (Shape_ShapeOfOp $x), $attr),
|
||||
(replaceWithValue $x)>;
|
||||
|
||||
|
|
Loading…
Reference in New Issue