[PATCH] D74647: [mlir][ODS] Add a new trait `TypesMatchWith`
Stephen Neuendorffer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 18 11:02:59 PST 2020
stephenneuendorffer added inline comments.
================
Comment at: mlir/include/mlir/Dialect/StandardOps/Ops.td:374
+ [NoSideEffect, SameTypeOperands, SameOperandsAndResultShape,
+ TypesMatchWith<"result type matches i1 of operand type",
+ "lhs", "result", "getI1SameShape($_self)">]> {
----------------
I can't parse this. suggest: result type has i1 element type and same shape as operands
================
Comment at: mlir/include/mlir/Dialect/StandardOps/Ops.td:441
+ [NoSideEffect, SameTypeOperands, SameOperandsAndResultShape,
+ TypesMatchWith<"result type matches i1 of operand type",
+ "lhs", "result", "getI1SameShape($_self)">]> {
----------------
I can't parse this...
================
Comment at: mlir/include/mlir/Dialect/StandardOps/Ops.td:1054
+ AllTypesMatch<["true_value", "false_value", "result"]>,
+ TypesMatchWith<"condition type matches i1 of result type",
+ "result", "condition",
----------------
I can't parse this...
================
Comment at: mlir/include/mlir/Dialect/StandardOps/Ops.td:1071-1073
+ let arguments = (ins BoolLike:$condition, IntegerOrFloatLike:$true_value,
+ IntegerOrFloatLike:$false_value);
+ let results = (outs IntegerOrFloatLike:$result);
----------------
Unrelated change? Why does this need to be IntegerOrFloatLike?
================
Comment at: mlir/include/mlir/Dialect/StandardOps/Ops.td:1225
+def StoreOp : Std_Op<"store",
+ [TypesMatchWith<"value type matches element type of memref",
+ "memref", "value",
----------------
This is similar to other comments but "value type" starts to be ambiguous in a message. maybe "type of value operand matches element type of memref operand" instead?
or "type of 'value' matches element type of 'memref'"
================
Comment at: mlir/include/mlir/Dialect/StandardOps/Ops.td:1490
+ [SameOperandsAndResultShape, SameOperandsAndResultElementType,
+ TypesMatchWith<"result type matches tensor equivalent of memref",
+ "memref", "result",
----------------
Ditto
================
Comment at: mlir/include/mlir/Dialect/StandardOps/Ops.td:1526
+ [SameOperandsShape, SameOperandsElementType,
+ TypesMatchWith<"value type matches tensor equivalent of memref",
+ "memref", "tensor",
----------------
Ditto
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74647/new/
https://reviews.llvm.org/D74647
More information about the llvm-commits
mailing list