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

Adrian Kuegel llvmlistbot at llvm.org
Wed Aug 23 08:53:33 PDT 2023


Author: Adrian Kuegel
Date: 2023-08-23T17:51:11+02:00
New Revision: 583e78b3727e4856ad0890167b8417e8c948da05

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

LOG: [mlir] Apply ClangTidy fixes (NFC)

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

Added: 
    

Modified: 
    mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp b/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
index cbcc82b23b8f9c..eddf3e9a47d0bc 100644
--- a/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
+++ b/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
@@ -593,7 +593,7 @@ void GpuToLLVMConversionPass::runOnOperation() {
         return converter.isLegal(op->getOperandTypes()) &&
                converter.isLegal(op->getResultTypes()) &&
                (module && module.getTargetsAttr() &&
-                module.getTargetsAttr().size());
+                !module.getTargetsAttr().empty());
       });
 
   mlir::arith::populateArithToLLVMConversionPatterns(converter, patterns);
@@ -1092,7 +1092,7 @@ LogicalResult ConvertLaunchFuncOpToGpuRuntimeCallPattern::matchAndRewrite(
   // If the module has Targets then just update the op operands.
   if (ArrayAttr targets = kernelModule.getTargetsAttr()) {
     Value stream = Value();
-    if (adaptor.getAsyncDependencies().size())
+    if (!adaptor.getAsyncDependencies().empty())
       stream = adaptor.getAsyncDependencies().front();
     // If the async keyword is present and there are no dependencies, then a
     // stream must be created to pass to subsequent operations.


        


More information about the Mlir-commits mailing list