@@ -139,8 +139,8 @@ def HasNoUseOf: Constraint<CPred<"$_self.use_empty()">, "has no use">;
139
139
140
140
// Check if two values have a ShapedType with the same element type.
141
141
def HasSameElementType : Constraint<
142
- CPred<"$0.getType().cast<ShapedType>( ).getElementType() == "
143
- "$1.getType().cast<ShapedType>( ).getElementType()">,
142
+ CPred<"cast<ShapedType>( $0.getType()).getElementType() == "
143
+ "cast<ShapedType>( $1.getType()).getElementType()">,
144
144
"values have same element type">;
145
145
146
146
def : Pattern<(TwoResultOp:$results $input),
@@ -161,8 +161,8 @@ Constraint HasNoUseOf(value: Value) [{
161
161
return success(value.use_empty());
162
162
}];
163
163
Constraint HasSameElementType(value1: Value, value2: Value) [{
164
- return success(value1.getType(). cast<ShapedType>().getElementType() ==
165
- value2.getType(). cast<ShapedType>().getElementType());
164
+ return success(cast<ShapedType>(value1.getType() ).getElementType() ==
165
+ cast<ShapedType>(value2.getType() ).getElementType());
166
166
}];
167
167
168
168
Pattern {
@@ -1105,8 +1105,8 @@ static LogicalResult hasOneUseImpl(PatternRewriter &rewriter, Value value) {
1105
1105
}
1106
1106
static LogicalResult hasSameElementTypeImpl(PatternRewriter &rewriter,
1107
1107
Value value1, Value Value2) {
1108
- return success(value1.getType(). cast<ShapedType >().getElementType() ==
1109
- value2.getType(). cast<ShapedType >().getElementType());
1108
+ return success(cast<ShapedType >(value1.getType() ).getElementType() ==
1109
+ cast<ShapedType >(value2.getType() ).getElementType());
1110
1110
}
1111
1111
1112
1112
void registerNativeConstraints(RewritePatternSet &patterns) {
@@ -1129,8 +1129,8 @@ Constraint HasOneUse(value: Value) [{
1129
1129
return success(value.hasOneUse());
1130
1130
}];
1131
1131
Constraint HasSameElementType(value1: Value, value2: Value) [{
1132
- return success(value1.getType(). cast<ShapedType>().getElementType() ==
1133
- value2.getType(). cast<ShapedType>().getElementType());
1132
+ return success(cast<ShapedType>(value1.getType() ).getElementType() ==
1133
+ cast<ShapedType>(value2.getType() ).getElementType());
1134
1134
}];
1135
1135
1136
1136
Pattern {
@@ -1160,8 +1160,8 @@ LogicalResult HasOneUse(PatternRewriter &rewriter, Value value) {
1160
1160
return success(value.hasOneUse());
1161
1161
}
1162
1162
LogicalResult HasSameElementType(Value value1, Value value2) {
1163
- return success(value1.getType(). cast<ShapedType >().getElementType() ==
1164
- value2.getType(). cast<ShapedType >().getElementType());
1163
+ return success(cast<ShapedType >(value1.getType() ).getElementType() ==
1164
+ cast<ShapedType >(value2.getType() ).getElementType());
1165
1165
}
1166
1166
```
1167
1167
0 commit comments