Changeset View
Changeset View
Standalone View
Standalone View
mlir/lib/Dialect/Shape/IR/ShapeCanonicalization.td
Show All 12 Lines | |||||
}]>>; | }]>>; | ||||
// Canonicalization patterns. | // Canonicalization patterns. | ||||
def AssumingAllOneOp : Pat<(Shape_AssumingAllOp $args), | def AssumingAllOneOp : Pat<(Shape_AssumingAllOp $args), | ||||
(replaceWithValue $args), | (replaceWithValue $args), | ||||
[(HasSingleElement $args)]>; | [(HasSingleElement $args)]>; | ||||
def CstrBroadcastableEqOps : Pat<(Shape_CstrBroadcastableOp:$op $x, $x), | def CstrBroadcastableEqOps : Pat<(Shape_CstrBroadcastableOp:$op $shapes), | ||||
(Shape_ConstWitnessOp ConstBoolAttrTrue)>; | (Shape_ConstWitnessOp ConstBoolAttrTrue), | ||||
[(AllInputShapesEq $shapes)]>; | |||||
def CstrEqEqOps : Pat<(Shape_CstrEqOp:$op $shapes), | def CstrEqEqOps : Pat<(Shape_CstrEqOp:$op $shapes), | ||||
(Shape_ConstWitnessOp ConstBoolAttrTrue), | (Shape_ConstWitnessOp ConstBoolAttrTrue), | ||||
[(AllInputShapesEq $shapes)]>; | [(AllInputShapesEq $shapes)]>; | ||||
def IndexToSizeToIndexCanonicalization : Pat< | def IndexToSizeToIndexCanonicalization : Pat< | ||||
(Shape_SizeToIndexOp (Shape_IndexToSizeOp $arg)), | (Shape_SizeToIndexOp (Shape_IndexToSizeOp $arg)), | ||||
(replaceWithValue $arg)>; | (replaceWithValue $arg)>; | ||||
Show All 9 Lines |