diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -1213,8 +1213,7 @@ struct MemRefsNormalizable : public TraitBase {}; -/// This trait tags element-wise ops that operate on scalars, vectors, or -/// tensors. +/// This trait tags element-wise ops on vectors or tensors. /// /// NOTE: Not all ops that are "elementwise" in some abstract sense satisfy this /// trait. In particular, broadcasting behavior is not allowed. @@ -1256,12 +1255,12 @@ /// This trait tags `Elementwise` operatons that can be systematically /// scalarized. All vector/tensor operands and results are then replaced by /// scalars of the respective element type. Semantically, this is the operation -/// on a single element per vector/tensor. +/// on a single element of the vector/tensor. /// /// Rationale: /// Allow to define the vector/tensor semantics of elementwise operations based -/// on scalars. This provides a constructive procedure for IR transformations -/// to, e.g., create scalar loop bodies from tensor ops. +/// on the same op's behavior on scalars. This provides a constructive procedure +/// for IR transformations to, e.g., create scalar loop bodies from tensor ops. /// /// Example: /// ``` @@ -1288,13 +1287,13 @@ /// This trait tags `Elementwise` operatons that can be systematically /// vectorized. All scalar operands and results are then replaced by vectors /// with the respective element type. Semantically, this is the operation on -/// multiple arguments simultaneously. +/// multiple elements simultaneously. See also `Tensorizable`. /// /// Rationale: /// Provide the reverse to `Scalarizable` which, when chained together, allows /// reasoning about the relationship between the tensor and vector case. /// Additionally, it permits reasoning about promoting scalars to vectors via -/// broadcasting in cases like `%select_scalar_pred` above. +/// broadcasting in cases like `%select_scalar_pred` below. template struct Vectorizable : public TraitBase { static LogicalResult verifyTrait(Operation *op) { @@ -1308,13 +1307,13 @@ /// This trait tags `Elementwise` operatons that can be systematically /// tensorized. All scalar operands and results are then replaced by tensors /// with the respective element type. Semantically, this is the operation on -/// multiple arguments simultaneously. +/// multiple elements simultaneously. See also `Vectorizable`. /// /// Rationale: /// Provide the reverse to `Scalarizable` which, when chained together, allows /// reasoning about the relationship between the tensor and vector case. /// Additionally, it permits reasoning about promoting scalars to tensors via -/// broadcasting in cases like `%select_scalar_pred` above. +/// broadcasting in cases like `%select_scalar_pred` below. /// /// Examples: /// ``` @@ -1323,7 +1322,7 @@ /// can be tensorized to /// ``` /// %tensor = "std.addf"(%a, %b) : (tensor, tensor) -/// -> tensor) +/// -> tensor /// ``` /// /// ```