[Mlir-commits] [mlir] bf92a76 - [mlir] Apply ClangTidy fixes (NFC)

Adrian Kuegel llvmlistbot at llvm.org
Wed Aug 23 08:21:38 PDT 2023


Author: Adrian Kuegel
Date: 2023-08-23T17:18:59+02:00
New Revision: bf92a7655cebae1e7b3ba16086c30ce0044217fb

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

LOG: [mlir] Apply ClangTidy fixes (NFC)

Prefer to use .empty() instead of checking size().

Added: 
    

Modified: 
    mlir/lib/Dialect/GPU/Transforms/ROCDLAttachTarget.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/GPU/Transforms/ROCDLAttachTarget.cpp b/mlir/lib/Dialect/GPU/Transforms/ROCDLAttachTarget.cpp
index 4f500fd337f4ce..925f4a9c1085dc 100644
--- a/mlir/lib/Dialect/GPU/Transforms/ROCDLAttachTarget.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/ROCDLAttachTarget.cpp
@@ -61,7 +61,7 @@ DictionaryAttr ROCDLAttachTarget::getFlags(OpBuilder &builder) const {
     addFlag("unsafe_math");
   if (!correctSqrtFlag)
     addFlag("unsafe_sqrt");
-  if (flags.size())
+  if (!flags.empty())
     return builder.getDictionaryAttr(flags);
   return nullptr;
 }
@@ -72,7 +72,7 @@ void ROCDLAttachTarget::runOnOperation() {
   SmallVector<StringRef> filesToLink(libs.begin(), libs.end());
   auto target = builder.getAttr<ROCDLTargetAttr>(
       optLevel, triple, chip, features, abiVersion, getFlags(builder),
-      filesToLink.size() ? builder.getStrArrayAttr(filesToLink) : nullptr);
+      filesToLink.empty() ? nullptr : builder.getStrArrayAttr(filesToLink));
   llvm::Regex matcher(moduleMatcher);
   for (Region &region : getOperation()->getRegions())
     for (Block &block : region.getBlocks())


        


More information about the Mlir-commits mailing list