[Mlir-commits] [clang-tools-extra] [mlir] [NFC][MLIR] Fix some typos (PR #108355)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 12 03:15:16 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 59731eebf8f24e3e90dc77e91a08d068b529cfc5 65c7658359b856bd736229d501def16027fd2a42 --extensions cpp,h -- clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp mlir/include/mlir/AsmParser/AsmParser.h mlir/include/mlir/Bytecode/BytecodeImplementation.h mlir/include/mlir/Bytecode/BytecodeReader.h mlir/include/mlir/Conversion/TosaToLinalg/TosaToLinalg.h mlir/include/mlir/Conversion/VectorToGPU/VectorToGPU.h mlir/include/mlir/Debug/BreakpointManagers/FileLineColLocBreakpointManager.h mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h mlir/include/mlir/Dialect/Linalg/Utils/Utils.h mlir/include/mlir/Dialect/SCF/Transforms/Transforms.h mlir/include/mlir/Dialect/SCF/Utils/Utils.h mlir/include/mlir/IR/OpImplementation.h mlir/include/mlir/IR/OperationSupport.h mlir/include/mlir/IR/Threading.h mlir/include/mlir/Interfaces/DataLayoutInterfaces.h mlir/include/mlir/Interfaces/Utils/InferIntRangeCommon.h mlir/include/mlir/Tools/PDLL/AST/Nodes.h mlir/include/mlir/Tools/PDLL/AST/Types.h mlir/include/mlir/Tools/PDLL/ODS/Context.h mlir/include/mlir/Tools/PDLL/ODS/Dialect.h mlir/include/mlir/Tools/PDLL/ODS/Operation.h mlir/include/mlir/Tools/ParseUtilities.h mlir/include/mlir/Tools/lsp-server-support/Protocol.h mlir/include/mlir/Transforms/DialectConversion.h mlir/include/mlir/Transforms/Inliner.h mlir/include/mlir/Transforms/OneToNTypeConversion.h mlir/include/mlir/Transforms/RegionUtils.h mlir/lib/Bindings/Python/IRModule.h mlir/lib/Conversion/GPUToNVVM/WmmaOpsToNvvm.cpp mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp mlir/lib/Dialect/Affine/IR/AffineOps.cpp mlir/lib/Dialect/Affine/Utils/Utils.cpp mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp mlir/lib/Dialect/Bufferization/Transforms/BufferUtils.cpp mlir/lib/Dialect/DLTI/DLTI.cpp mlir/lib/Dialect/GPU/Transforms/AllReduceLowering.cpp mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp mlir/lib/Dialect/Linalg/Transforms/EraseUnusedOperandsAndResults.cpp mlir/lib/Dialect/Linalg/Transforms/NamedOpConversions.cpp mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp mlir/lib/Dialect/MemRef/Transforms/EmulateWideInt.cpp mlir/lib/Dialect/SCF/Utils/Utils.cpp mlir/lib/Dialect/SPIRV/Transforms/UnifyAliasedResourcePass.cpp mlir/lib/Dialect/Tensor/IR/TensorInferTypeOpInterfaceImpl.cpp mlir/lib/Dialect/Tensor/IR/TensorOps.cpp mlir/lib/IR/BuiltinTypes.cpp mlir/lib/Interfaces/DataLayoutInterfaces.cpp mlir/lib/Target/LLVMIR/DataLayoutImporter.cpp mlir/lib/Target/LLVMIR/DataLayoutImporter.h mlir/lib/Target/LLVMIR/ModuleTranslation.cpp mlir/lib/Tools/PDLL/ODS/Context.cpp mlir/lib/Tools/PDLL/ODS/Dialect.cpp mlir/lib/Tools/PDLL/ODS/Operation.cpp mlir/lib/Tools/PDLL/Parser/Parser.cpp mlir/lib/Transforms/InlinerPass.cpp mlir/lib/Transforms/RemoveDeadValues.cpp mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp mlir/lib/Transforms/Utils/Inliner.cpp mlir/test/lib/Dialect/DLTI/TestDataLayoutQuery.cpp mlir/test/lib/IR/TestSymbolUses.cpp mlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp mlir/unittests/Debug/FileLineColLocBreakpointManagerTest.cpp mlir/unittests/Dialect/OpenACC/OpenACCOpsTest.cpp mlir/unittests/IR/AttrTypeReplacerTest.cpp mlir/unittests/IR/InterfaceAttachmentTest.cpp mlir/unittests/IR/OpPropertiesTest.cpp mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/include/mlir/Transforms/DialectConversion.h b/mlir/include/mlir/Transforms/DialectConversion.h
index 08283e3b15..8b1272ea98 100644
--- a/mlir/include/mlir/Transforms/DialectConversion.h
+++ b/mlir/include/mlir/Transforms/DialectConversion.h
@@ -218,12 +218,13 @@ public:
   ///
   /// The conversion functions take a non-null Type or subclass of Type and a
   /// non-null Attribute (or subclass of Attribute), and returns a
-  /// `AttributeConversionResult`. This result can either contain an `Attribute`,
-  /// which may be `nullptr`, representing the conversion's success,
-  /// `AttributeConversionResult::na()` (the default empty value), indicating
-  /// that the conversion function did not apply and that further conversion
-  /// functions should be checked, or `AttributeConversionResult::abort()`
-  /// indicating that the conversion process should be aborted.
+  /// `AttributeConversionResult`. This result can either contain an
+  /// `Attribute`, which may be `nullptr`, representing the conversion's
+  /// success, `AttributeConversionResult::na()` (the default empty value),
+  /// indicating that the conversion function did not apply and that further
+  /// conversion functions should be checked, or
+  /// `AttributeConversionResult::abort()` indicating that the conversion
+  /// process should be aborted.
   ///
   /// Registered conversion functions are called in the reverse of the order in
   /// which they were registered.
diff --git a/mlir/lib/Dialect/DLTI/DLTI.cpp b/mlir/lib/Dialect/DLTI/DLTI.cpp
index c6a13249fd..925beb90c4 100644
--- a/mlir/lib/Dialect/DLTI/DLTI.cpp
+++ b/mlir/lib/Dialect/DLTI/DLTI.cpp
@@ -508,10 +508,11 @@ public:
           (value.getValue() == DLTIDialect::kDataLayoutEndiannesssBig ||
            value.getValue() == DLTIDialect::kDataLayoutEndiannesssLittle))
         return success();
-      return emitError(loc) << "'" << entryName
-                            << "' data layout entry is expected to be either '"
-                            << DLTIDialect::kDataLayoutEndiannesssBig << "' or '"
-                            << DLTIDialect::kDataLayoutEndiannesssLittle << "'";
+      return emitError(loc)
+             << "'" << entryName
+             << "' data layout entry is expected to be either '"
+             << DLTIDialect::kDataLayoutEndiannesssBig << "' or '"
+             << DLTIDialect::kDataLayoutEndiannesssLittle << "'";
     }
     if (entryName == DLTIDialect::kDataLayoutAllocaMemorySpaceKey ||
         entryName == DLTIDialect::kDataLayoutProgramMemorySpaceKey ||
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
index 2a8259ed8a..0976bab6c8 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
@@ -174,7 +174,8 @@ static bool areConversionCompatible(const DataLayout &layout, Type targetType,
 
 /// Checks if `dataLayout` describes a little endian layout.
 static bool isBigEndian(const DataLayout &dataLayout) {
-  auto endiannessStr = dyn_cast_or_null<StringAttr>(dataLayout.getEndiannesss());
+  auto endiannessStr =
+      dyn_cast_or_null<StringAttr>(dataLayout.getEndiannesss());
   return endiannessStr && endiannessStr == "big";
 }
 
diff --git a/mlir/lib/Target/LLVMIR/DataLayoutImporter.cpp b/mlir/lib/Target/LLVMIR/DataLayoutImporter.cpp
index b4a9f45130..3d87f0cae1 100644
--- a/mlir/lib/Target/LLVMIR/DataLayoutImporter.cpp
+++ b/mlir/lib/Target/LLVMIR/DataLayoutImporter.cpp
@@ -150,7 +150,7 @@ DataLayoutImporter::tryToEmplacePointerAlignmentEntry(LLVMPointerType type,
 
 LogicalResult
 DataLayoutImporter::tryToEmplaceEndiannesssEntry(StringRef endianness,
-                                                StringRef token) {
+                                                 StringRef token) {
   auto key = StringAttr::get(context, DLTIDialect::kDataLayoutEndiannesssKey);
   if (keyEntries.count(key))
     return success();
diff --git a/mlir/lib/Target/LLVMIR/DataLayoutImporter.h b/mlir/lib/Target/LLVMIR/DataLayoutImporter.h
index c7dd233162..5642fb9418 100644
--- a/mlir/lib/Target/LLVMIR/DataLayoutImporter.h
+++ b/mlir/lib/Target/LLVMIR/DataLayoutImporter.h
@@ -94,7 +94,7 @@ private:
 
   /// Adds an endianness entry if there is none yet.
   LogicalResult tryToEmplaceEndiannesssEntry(StringRef endianness,
-                                            StringRef token);
+                                             StringRef token);
 
   /// Adds an alloca address space entry if there is none yet.
   LogicalResult tryToEmplaceAddrSpaceEntry(StringRef token,
diff --git a/mlir/lib/Tools/PDLL/Parser/Parser.cpp b/mlir/lib/Tools/PDLL/Parser/Parser.cpp
index 8b54dbe4c7..7d54968049 100644
--- a/mlir/lib/Tools/PDLL/Parser/Parser.cpp
+++ b/mlir/lib/Tools/PDLL/Parser/Parser.cpp
@@ -434,7 +434,7 @@ private:
                                          const ods::Operation *odsOp,
                                          SmallVectorImpl<ast::Expr *> &results);
   void checkOperationResultTypeInference(SMRange loc, StringRef name,
-                                          const ods::Operation *odsOp);
+                                         const ods::Operation *odsOp);
   LogicalResult validateOperationOperandsOrResults(
       StringRef groupName, SMRange loc, std::optional<SMRange> odsOpLoc,
       std::optional<StringRef> name, SmallVectorImpl<ast::Expr *> &values,
@@ -2892,7 +2892,7 @@ Parser::validateOperationResults(SMRange loc, std::optional<StringRef> name,
 }
 
 void Parser::checkOperationResultTypeInference(SMRange loc, StringRef opName,
-                                                const ods::Operation *odsOp) {
+                                               const ods::Operation *odsOp) {
   // If the operation might not have inference support, emit a warning to the
   // user. We don't emit an error because the interface might be added to the
   // operation at runtime. It's rare, but it could still happen. We emit a
diff --git a/mlir/unittests/IR/AttrTypeReplacerTest.cpp b/mlir/unittests/IR/AttrTypeReplacerTest.cpp
index da4baaee4b..6f696f84d9 100644
--- a/mlir/unittests/IR/AttrTypeReplacerTest.cpp
+++ b/mlir/unittests/IR/AttrTypeReplacerTest.cpp
@@ -181,7 +181,8 @@ public:
   int invokeCount = 0;
 };
 
-TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest, testPruneAnywhere0) {
+TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest,
+       testPruneAnywhere0) {
   setBaseCase(std::nullopt);
 
   // No recursion case.
@@ -203,7 +204,8 @@ TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest, testPruneAnywhere0)
   EXPECT_EQ(invokeCount, 2);
 }
 
-TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest, testPruneAnywhere1) {
+TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest,
+       testPruneAnywhere1) {
   setBaseCase(std::nullopt);
 
   // Starting at 1. Cycle length is 3.
@@ -212,7 +214,8 @@ TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest, testPruneAnywhere1)
   EXPECT_EQ(invokeCount, 3);
 }
 
-TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest, testPruneSpecific0) {
+TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest,
+       testPruneSpecific0) {
   setBaseCase(0);
 
   // Starting at 0. Cycle length is 3.
@@ -221,7 +224,8 @@ TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest, testPruneSpecific0)
   EXPECT_EQ(invokeCount, 3);
 }
 
-TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest, testPruneSpecific1) {
+TEST_F(CyclicAttrTypeReplacerBranchingRecursionPruningTest,
+       testPruneSpecific1) {
   setBaseCase(0);
 
   // Starting at 1. Cycle length is 5 (1 -> 2 -> 0 -> 1 -> 2 -> Prune).

``````````

</details>


https://github.com/llvm/llvm-project/pull/108355


More information about the Mlir-commits mailing list