[Mlir-commits] [mlir] 93228cf - [mlir] Apply ClangTidy fix (NFC)

Adrian Kuegel llvmlistbot at llvm.org
Tue Aug 22 04:55:50 PDT 2023


Author: Adrian Kuegel
Date: 2023-08-22T13:55:09+02:00
New Revision: 93228cff8f496cc46dd46e772b3e4ff8a593f0fa

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

LOG: [mlir] Apply ClangTidy fix (NFC)

Use .empty() instead of checking for size().

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/GPU/Transforms/NVVMAttachTarget.cpp b/mlir/lib/Dialect/GPU/Transforms/NVVMAttachTarget.cpp
index f159cdedfaea10..e4efcacaa75246 100644
--- a/mlir/lib/Dialect/GPU/Transforms/NVVMAttachTarget.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/NVVMAttachTarget.cpp
@@ -53,7 +53,7 @@ DictionaryAttr NVVMAttachTarget::getFlags(OpBuilder &builder) const {
     addFlag("fast");
   if (ftzFlag)
     addFlag("ftz");
-  if (flags.size())
+  if (!flags.empty())
     return builder.getDictionaryAttr(flags);
   return nullptr;
 }
@@ -64,7 +64,7 @@ void NVVMAttachTarget::runOnOperation() {
   SmallVector<StringRef> filesToLink(libs.begin(), libs.end());
   auto target = builder.getAttr<NVVMTargetAttr>(
       optLevel, triple, chip, features, 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