[Mlir-commits] [mlir] 4dc39ae - [mlir] Fix typo

Jacques Pienaar llvmlistbot at llvm.org
Fri Feb 28 11:05:14 PST 2020


Author: Jacques Pienaar
Date: 2020-02-28T10:59:52-08:00
New Revision: 4dc39ae7520b66b17557729404a97c5cb90b7196

URL: https://github.com/llvm/llvm-project/commit/4dc39ae7520b66b17557729404a97c5cb90b7196
DIFF: https://github.com/llvm/llvm-project/commit/4dc39ae7520b66b17557729404a97c5cb90b7196.diff

LOG: [mlir] Fix typo

Added: 
    

Modified: 
    mlir/docs/ShapeInference.md
    mlir/include/mlir/Analysis/InferTypeOpInterface.h
    mlir/include/mlir/Analysis/InferTypeOpInterface.td
    mlir/lib/Analysis/InferTypeOpInterface.cpp
    mlir/test/lib/TestDialect/TestDialect.cpp
    mlir/test/lib/TestDialect/TestPatterns.cpp
    mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/docs/ShapeInference.md b/mlir/docs/ShapeInference.md
index 9608d268aaf6..09737855f8ef 100644
--- a/mlir/docs/ShapeInference.md
+++ b/mlir/docs/ShapeInference.md
@@ -43,7 +43,7 @@ exceptional case.
 Shape inference is currently tested alongside type inference by
 `TestReturnTypeDriver` in the test dialect. This driver performs two checks:
 
-1.  Verification that the return types specified matches the infered types. This
+1.  Verification that the return types specified matches the inferred types. This
     explicit check will be removed and made part of Op verification instead.
 2.  Test the creation of Ops without specifying the return type explicitly in
     function `testCreateFunctions` by creating new binary Ops (Op classes

diff  --git a/mlir/include/mlir/Analysis/InferTypeOpInterface.h b/mlir/include/mlir/Analysis/InferTypeOpInterface.h
index 4c2628512cf4..26323e430a43 100644
--- a/mlir/include/mlir/Analysis/InferTypeOpInterface.h
+++ b/mlir/include/mlir/Analysis/InferTypeOpInterface.h
@@ -87,7 +87,7 @@ LogicalResult inferReturnTensorTypes(
         componentTypeFn,
     MLIRContext *context, Optional<Location> location, ValueRange operands,
     ArrayRef<NamedAttribute> attributes, RegionRange regions,
-    SmallVectorImpl<Type> &inferedReturnTypes);
+    SmallVectorImpl<Type> &inferredReturnTypes);
 
 /// Verifies that the inferred result types match the actual result types for
 /// the op. Precondition: op implements InferTypeOpInterface.
@@ -98,7 +98,7 @@ LogicalResult verifyInferredResultTypes(Operation *op);
 
 namespace OpTrait {
 
-/// Tensor type inference trait that constructs a tensor from the infered
+/// Tensor type inference trait that constructs a tensor from the inferred
 /// shape and elemental types.
 /// Requires: Op implements functions of InferShapedTypeOpInterface.
 template <typename ConcreteType>
@@ -108,10 +108,10 @@ class InferTensorType : public TraitBase<ConcreteType, InferTensorType> {
   inferReturnTypes(MLIRContext *context, Optional<Location> location,
                    ValueRange operands, ArrayRef<NamedAttribute> attributes,
                    RegionRange regions,
-                   SmallVectorImpl<Type> &inferedReturnTypes) {
+                   SmallVectorImpl<Type> &inferredReturnTypes) {
     return ::mlir::detail::inferReturnTensorTypes(
         ConcreteType::inferReturnTypeComponents, context, location, operands,
-        attributes, regions, inferedReturnTypes);
+        attributes, regions, inferredReturnTypes);
   }
 };
 

diff  --git a/mlir/include/mlir/Analysis/InferTypeOpInterface.td b/mlir/include/mlir/Analysis/InferTypeOpInterface.td
index 548cd09a14c3..aec8c0a626ac 100644
--- a/mlir/include/mlir/Analysis/InferTypeOpInterface.td
+++ b/mlir/include/mlir/Analysis/InferTypeOpInterface.td
@@ -42,7 +42,7 @@ def InferTypeOpInterface : OpInterface<"InferTypeOpInterface"> {
                     "ValueRange":$operands,
                     "ArrayRef<NamedAttribute>":$attributes,
                     "RegionRange":$regions,
-                    "SmallVectorImpl<Type>&":$inferedReturnTypes)
+                    "SmallVectorImpl<Type>&":$inferredReturnTypes)
     >,
     StaticInterfaceMethod<
       /*desc=*/"Returns whether two array of types are compatible result types"
@@ -95,7 +95,7 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> {
                     "ArrayRef<NamedAttribute>":$attributes,
                     "RegionRange":$regions,
                     "SmallVectorImpl<ShapedTypeComponents>&":
-                      $inferedReturnShapes)
+                      $inferredReturnShapes)
     >,
     InterfaceMethod<
       /*desc=*/[{Reify the shape computation for the operation.

diff  --git a/mlir/lib/Analysis/InferTypeOpInterface.cpp b/mlir/lib/Analysis/InferTypeOpInterface.cpp
index 4b4be52d6626..8cf8ec485e9f 100644
--- a/mlir/lib/Analysis/InferTypeOpInterface.cpp
+++ b/mlir/lib/Analysis/InferTypeOpInterface.cpp
@@ -29,7 +29,7 @@ LogicalResult mlir::detail::inferReturnTensorTypes(
         componentTypeFn,
     MLIRContext *context, Optional<Location> location, ValueRange operands,
     ArrayRef<NamedAttribute> attributes, RegionRange regions,
-    SmallVectorImpl<Type> &inferedReturnTypes) {
+    SmallVectorImpl<Type> &inferredReturnTypes) {
   SmallVector<ShapedTypeComponents, 2> retComponents;
   if (failed(componentTypeFn(context, location, operands, attributes, regions,
                              retComponents)))
@@ -37,23 +37,23 @@ LogicalResult mlir::detail::inferReturnTensorTypes(
   for (auto shapeAndType : retComponents) {
     assert(shapeAndType.getAttribute() == nullptr && "attribute not supported");
     if (shapeAndType.hasRank())
-      inferedReturnTypes.push_back(RankedTensorType::get(
+      inferredReturnTypes.push_back(RankedTensorType::get(
           shapeAndType.getDims(), shapeAndType.getElementType()));
     else
-      inferedReturnTypes.push_back(
+      inferredReturnTypes.push_back(
           UnrankedTensorType::get(shapeAndType.getElementType()));
   }
   return success();
 }
 
 LogicalResult mlir::detail::verifyInferredResultTypes(Operation *op) {
-  SmallVector<Type, 4> inferedReturnTypes;
+  SmallVector<Type, 4> inferredReturnTypes;
   auto retTypeFn = cast<InferTypeOpInterface>(op);
   if (failed(retTypeFn.inferReturnTypes(op->getContext(), op->getLoc(),
                                         op->getOperands(), op->getAttrs(),
-                                        op->getRegions(), inferedReturnTypes)))
+                                        op->getRegions(), inferredReturnTypes)))
     return failure();
-  if (!retTypeFn.isCompatibleReturnTypes(inferedReturnTypes,
+  if (!retTypeFn.isCompatibleReturnTypes(inferredReturnTypes,
                                          op->getResultTypes()))
     return op->emitOpError(
         "inferred type incompatible with return type of operation");

diff  --git a/mlir/test/lib/TestDialect/TestDialect.cpp b/mlir/test/lib/TestDialect/TestDialect.cpp
index 12ec279c1d67..3ded7b95b9f9 100644
--- a/mlir/test/lib/TestDialect/TestDialect.cpp
+++ b/mlir/test/lib/TestDialect/TestDialect.cpp
@@ -300,20 +300,20 @@ LogicalResult TestOpWithVariadicResultsAndFolder::fold(
 LogicalResult mlir::OpWithInferTypeInterfaceOp::inferReturnTypes(
     MLIRContext *, Optional<Location> location, ValueRange operands,
     ArrayRef<NamedAttribute> attributes, RegionRange regions,
-    SmallVectorImpl<Type> &inferedReturnTypes) {
+    SmallVectorImpl<Type> &inferredReturnTypes) {
   if (operands[0].getType() != operands[1].getType()) {
     return emitOptionalError(location, "operand type mismatch ",
                              operands[0].getType(), " vs ",
                              operands[1].getType());
   }
-  inferedReturnTypes.assign({operands[0].getType()});
+  inferredReturnTypes.assign({operands[0].getType()});
   return success();
 }
 
 LogicalResult OpWithShapedTypeInferTypeInterfaceOp::inferReturnTypeComponents(
     MLIRContext *context, Optional<Location> location, ValueRange operands,
     ArrayRef<NamedAttribute> attributes, RegionRange regions,
-    SmallVectorImpl<ShapedTypeComponents> &inferedReturnShapes) {
+    SmallVectorImpl<ShapedTypeComponents> &inferredReturnShapes) {
   // Create return type consisting of the last element of the first operand.
   auto operandType = *operands.getTypes().begin();
   auto sval = operandType.dyn_cast<ShapedType>();
@@ -323,7 +323,7 @@ LogicalResult OpWithShapedTypeInferTypeInterfaceOp::inferReturnTypeComponents(
   int64_t dim =
       sval.hasRank() ? sval.getShape().front() : ShapedType::kDynamicSize;
   auto type = IntegerType::get(17, context);
-  inferedReturnShapes.push_back(ShapedTypeComponents({dim}, type));
+  inferredReturnShapes.push_back(ShapedTypeComponents({dim}, type));
   return success();
 }
 

diff  --git a/mlir/test/lib/TestDialect/TestPatterns.cpp b/mlir/test/lib/TestDialect/TestPatterns.cpp
index decb5e246a81..3760ed7dae90 100644
--- a/mlir/test/lib/TestDialect/TestPatterns.cpp
+++ b/mlir/test/lib/TestDialect/TestPatterns.cpp
@@ -55,9 +55,9 @@ struct TestPatternDriver : public FunctionPass<TestPatternDriver> {
 //===----------------------------------------------------------------------===//
 
 namespace {
-// Generate ops for each instance where the type can be successfully infered.
+// Generate ops for each instance where the type can be successfully inferred.
 template <typename OpTy>
-static void invokeCreateWithInferedReturnType(Operation *op) {
+static void invokeCreateWithInferredReturnType(Operation *op) {
   auto *context = op->getContext();
   auto fop = op->getParentOfType<FuncOp>();
   auto location = UnknownLoc::get(context);
@@ -69,10 +69,10 @@ static void invokeCreateWithInferedReturnType(Operation *op) {
   for (int i = 0, e = fop.getNumArguments(); i < e; ++i) {
     for (int j = 0; j < e; ++j) {
       std::array<Value, 2> values = {{fop.getArgument(i), fop.getArgument(j)}};
-      SmallVector<Type, 2> inferedReturnTypes;
+      SmallVector<Type, 2> inferredReturnTypes;
       if (succeeded(OpTy::inferReturnTypes(context, llvm::None, values,
                                            op->getAttrs(), op->getRegions(),
-                                           inferedReturnTypes))) {
+                                           inferredReturnTypes))) {
         OperationState state(location, OpTy::getOperationName());
         // TODO(jpienaar): Expand to regions.
         OpTy::build(&b, state, values, op->getAttrs());
@@ -107,9 +107,9 @@ struct TestReturnTypeDriver : public FunctionPass<TestReturnTypeDriver> {
         // Test create method of each of the Op classes below. The resultant
         // output would be in reverse order underneath `op` from which
         // the attributes and regions are used.
-        invokeCreateWithInferedReturnType<OpWithInferTypeInterfaceOp>(op);
-        invokeCreateWithInferedReturnType<OpWithShapedTypeInferTypeInterfaceOp>(
-            op);
+        invokeCreateWithInferredReturnType<OpWithInferTypeInterfaceOp>(op);
+        invokeCreateWithInferredReturnType<
+            OpWithShapedTypeInferTypeInterfaceOp>(op);
       };
       return;
     }

diff  --git a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
index d8a4b91c026e..f4d114aaab8f 100644
--- a/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
@@ -206,7 +206,7 @@ class OpEmitter {
   // Generates the build() method that takes aggregate operands/attributes
   // parameters. This build() method uses inferred types as result types.
   // Requires: The type needs to be inferable via InferTypeOpInterface.
-  void genInferedTypeCollectiveParamBuilder();
+  void genInferredTypeCollectiveParamBuilder();
 
   // Generates the build() method that takes each operand/attribute as a
   // stand-alone parameter. The generated build() method uses first attribute's
@@ -669,14 +669,14 @@ void OpEmitter::genSeparateArgParamBuilder() {
     if (inferType) {
       // Generate builder that infers type too.
       // TODO(jpienaar): Subsume this with general checking if type can be
-      // infered automatically.
+      // inferred automatically.
       // TODO(jpienaar): Expand to handle regions.
       body << formatv(R"(
-        SmallVector<Type, 2> inferedReturnTypes;
+        SmallVector<Type, 2> inferredReturnTypes;
         if (succeeded({0}::inferReturnTypes(odsBuilder->getContext(),
                       {1}.location, {1}.operands, {1}.attributes,
-                      /*regions=*/{{}, inferedReturnTypes)))
-          {1}.addTypes(inferedReturnTypes);
+                      /*regions=*/{{}, inferredReturnTypes)))
+          {1}.addTypes(inferredReturnTypes);
         else
           llvm::report_fatal_error("Failed to infer result type(s).");)",
                       opClass.getClassName(), builderOpState);
@@ -746,7 +746,7 @@ void OpEmitter::genUseOperandAsResultTypeCollectiveParamBuilder() {
        << llvm::join(resultTypes, ", ") << "});\n\n";
 }
 
-void OpEmitter::genInferedTypeCollectiveParamBuilder() {
+void OpEmitter::genInferredTypeCollectiveParamBuilder() {
   // TODO(jpienaar): Expand to support regions.
   const char *params =
       "Builder *odsBuilder, OperationState &{0}, "
@@ -756,11 +756,11 @@ void OpEmitter::genInferedTypeCollectiveParamBuilder() {
                         OpMethod::MP_Static);
   auto &body = m.body();
   body << formatv(R"(
-    SmallVector<Type, 2> inferedReturnTypes;
+    SmallVector<Type, 2> inferredReturnTypes;
     if (succeeded({0}::inferReturnTypes(odsBuilder->getContext(),
                   {1}.location, operands, attributes,
-                  /*regions=*/{{}, inferedReturnTypes)))
-      build(odsBuilder, odsState, inferedReturnTypes, operands, attributes);
+                  /*regions=*/{{}, inferredReturnTypes)))
+      build(odsBuilder, odsState, inferredReturnTypes, operands, attributes);
     else
       llvm::report_fatal_error("Failed to infer result type(s).");)",
                   opClass.getClassName(), builderOpState);
@@ -911,12 +911,12 @@ void OpEmitter::genCollectiveParamBuilder() {
   body << "  " << builderOpState << ".addTypes(resultTypes);\n";
 
   // Generate builder that infers type too.
-  // TODO(jpienaar): Subsume this with general checking if type can be infered
+  // TODO(jpienaar): Subsume this with general checking if type can be inferred
   // automatically.
   // TODO(jpienaar): Expand to handle regions and successors.
   if (op.getTrait("InferTypeOpInterface::Trait") && op.getNumRegions() == 0 &&
       op.getNumSuccessors() == 0)
-    genInferedTypeCollectiveParamBuilder();
+    genInferredTypeCollectiveParamBuilder();
 }
 
 void OpEmitter::buildParamList(std::string &paramList,


        


More information about the Mlir-commits mailing list