Apply clang-tidy fixes for readability-simplify-boolean-expr in CSE.cpp (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Thu, 17 Nov 2022 10:40:56 +0000 (10:40 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 23 Nov 2022 00:52:35 +0000 (00:52 +0000)
mlir/lib/Transforms/CSE.cpp

index 97f6cfd..5e5852a 100644 (file)
@@ -263,8 +263,8 @@ LogicalResult CSE::simplifyOperation(ScopedMapTy &knownValues, Operation *op,
   // Don't simplify operations with nested blocks. We don't currently model
   // equality comparisons correctly among other things. It is also unclear
   // whether we would want to CSE such operations.
-  if (!(op->getNumRegions() == 0 ||
-        (op->getNumRegions() == 1 && llvm::hasSingleElement(op->getRegion(0)))))
+  if (op->getNumRegions() != 0 &&
+      (op->getNumRegions() != 1 || !llvm::hasSingleElement(op->getRegion(0))))
     return failure();
 
   // Some simple use case of operation with memory side-effect are dealt with