[Mlir-commits] [mlir] ac7a274 - Apply clang-tidy fixes for llvm-else-after-return in CommonFolders.h (NFC)

Mehdi Amini llvmlistbot at llvm.org
Thu Jan 13 15:26:25 PST 2022


Author: Mehdi Amini
Date: 2022-01-13T23:25:49Z
New Revision: ac7a2742b2c6a173c24558742762b9b0b6ec23c0

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

LOG: Apply clang-tidy fixes for llvm-else-after-return in CommonFolders.h (NFC)

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/CommonFolders.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/CommonFolders.h b/mlir/include/mlir/Dialect/CommonFolders.h
index a52b89027c5b..b3f600ed4ff4 100644
--- a/mlir/include/mlir/Dialect/CommonFolders.h
+++ b/mlir/include/mlir/Dialect/CommonFolders.h
@@ -41,8 +41,9 @@ Attribute constFoldBinaryOp(ArrayRef<Attribute> operands,
 
     return AttrElementT::get(lhs.getType(),
                              calculate(lhs.getValue(), rhs.getValue()));
-  } else if (operands[0].isa<SplatElementsAttr>() &&
-             operands[1].isa<SplatElementsAttr>()) {
+  }
+  if (operands[0].isa<SplatElementsAttr>() &&
+      operands[1].isa<SplatElementsAttr>()) {
     // Both operands are splats so we can avoid expanding the values out and
     // just fold based on the splat value.
     auto lhs = operands[0].cast<SplatElementsAttr>();


        


More information about the Mlir-commits mailing list