Apply clang-tidy fixes for llvm-else-after-return in CommonFolders.h (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Tue, 11 Jan 2022 20:49:18 +0000 (20:49 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Thu, 13 Jan 2022 23:25:49 +0000 (23:25 +0000)
mlir/include/mlir/Dialect/CommonFolders.h

index a52b890..b3f600e 100644 (file)
@@ -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>();