Fix warnings
authorKazu Hirata <kazu@google.com>
Mon, 10 Apr 2023 17:11:41 +0000 (10:11 -0700)
committerKazu Hirata <kazu@google.com>
Mon, 10 Apr 2023 17:11:41 +0000 (10:11 -0700)
This patch fixes:

  mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp:1334:51:
  warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]

  lld/wasm/Writer.cpp:250:39: warning: suggest parentheses around ‘&&’
  within ‘||’ [-Wparentheses]

lld/wasm/Writer.cpp
mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp

index d9e8727..2ec8848 100644 (file)
@@ -247,7 +247,7 @@ computeHash(llvm::MutableArrayRef<uint8_t> hashBuf,
 
 static void makeUUID(unsigned version, llvm::ArrayRef<uint8_t> fileHash,
                      llvm::MutableArrayRef<uint8_t> output) {
-  assert(version == 4 || version == 5 && "Unknown UUID version");
+  assert((version == 4 || version == 5) && "Unknown UUID version");
   assert(output.size() == 16 && "Wrong size for UUID output");
   if (version == 5) {
     // Build a valid v5 UUID from a hardcoded (randomly-generated) namespace
index e548615..d74a603 100644 (file)
@@ -1330,9 +1330,9 @@ packMatmulGreedily(RewriterBase &rewriter, LinalgOp linalgOp,
                    ArrayRef<int64_t> mnkPaddedSizesNextMultipleOf,
                    ArrayRef<int64_t> mnkOrder) {
   assert(mnkPackedSizes.size() == 3 && "unexpected num of packing sizes");
-  assert(mnkPaddedSizesNextMultipleOf.empty() ||
-         mnkPaddedSizesNextMultipleOf.size() == 3 &&
-             "num of packing sizes next multiple should be empty or of size 3");
+  assert((mnkPaddedSizesNextMultipleOf.empty() ||
+          mnkPaddedSizesNextMultipleOf.size() == 3) &&
+         "num of packing sizes next multiple should be empty or of size 3");
   assert(mnkOrder.size() == 3 && "unexpected mnkOrder size");
   assert(isPermutationVector(mnkOrder) && "expected a permutation");