[Mlir-commits] [mlir] [mlir] remove some GCC warning #68409 (PR #68528)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Oct 9 20:00:45 PDT 2023
https://github.com/lipracer updated https://github.com/llvm/llvm-project/pull/68528
>From bcb7626750275eea8be6067f35b7b0ffbbde7e8c Mon Sep 17 00:00:00 2001
From: lipracer <lipracer at gmail.com>
Date: Tue, 10 Oct 2023 10:27:58 +0800
Subject: [PATCH] [mlir] remove some GCC warning (#68409)
also remove `comparison of unsigned expression >= 0`
---
mlir/CMakeLists.txt | 9 +++++++++
mlir/lib/Dialect/Transform/IR/TransformOps.cpp | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index bbbcb0703f20f42..ac120aad0d1eda7 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -77,6 +77,15 @@ check_c_compiler_flag("-Werror=mismatched-tags" C_SUPPORTS_WERROR_MISMATCHED_TAG
append_if(C_SUPPORTS_WERROR_MISMATCHED_TAGS "-Werror=mismatched-tags" CMAKE_C_FLAGS)
append_if(C_SUPPORTS_WERROR_MISMATCHED_TAGS "-Werror=mismatched-tags" CMAKE_CXX_FLAGS)
+# Silence a false positive GCC -Wunused-but-set-parameter warning in constexpr
+# cases, by marking SelectedCase as used. See
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85827 for details. The issue is
+# fixed in GCC 10.
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0")
+ check_cxx_compiler_flag("-Wno-unused-but-set-parameter" CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER)
+ append_if(CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER "-Wno-unused-but-set-parameter" CMAKE_CXX_FLAGS)
+endif()
+
# Installing the headers and docs needs to depend on generating any public
# tablegen'd targets.
# mlir-generic-headers are dialect-independent.
diff --git a/mlir/lib/Dialect/Transform/IR/TransformOps.cpp b/mlir/lib/Dialect/Transform/IR/TransformOps.cpp
index 0e20b379cc2a3e7..f8eb20e1a1da9c6 100644
--- a/mlir/lib/Dialect/Transform/IR/TransformOps.cpp
+++ b/mlir/lib/Dialect/Transform/IR/TransformOps.cpp
@@ -1996,7 +1996,7 @@ void transform::SplitHandleOp::getEffects(
LogicalResult transform::SplitHandleOp::verify() {
if (getOverflowResult().has_value() &&
- !(*getOverflowResult() >= 0 && *getOverflowResult() < getNumResults()))
+ !(*getOverflowResult() < getNumResults()))
return emitOpError("overflow_result is not a valid result index");
return success();
}
More information about the Mlir-commits
mailing list