[Mlir-commits] [mlir] [MLIR][CMake] Suppress -Wpass-failed warning (PR #160472)
Nikita Popov
llvmlistbot at llvm.org
Wed Sep 24 01:57:48 PDT 2025
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/160472
libstdc++15 makes use of an unroll pragma inside std::find_if(). This produces a warning if clang fails to unroll the loop. As this pragma is outside of our control, suppress the warning. Missed transforms are not something we care about in this context.
Fixes https://github.com/llvm/llvm-project/issues/157666.
>From b42cb0543cf2fe52089079b18409d5eb86b492c5 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Wed, 24 Sep 2025 10:54:00 +0200
Subject: [PATCH] [MLIR][CMake] Suppress -Wpass-failed warning
libstdc++15 makes use of an unroll pragma inside std::find_if(). This
produces a warning if clang fails to unroll the loop. As this pragma is
outside of our control, suppress the warning.
---
mlir/CMakeLists.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 1a211f5495764..da340c4e36784 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -110,6 +110,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
endif()
endif()
+# libstdc++15 makes use of an unroll pragma inside std::find_if(). This
+# produces a warning if clang fails to unroll the loop. As this pragma is
+# outside of our control, suppress the warning.
+check_cxx_compiler_flag("-Wno-pass-failed" CXX_SUPPORTS_WNO_PASS_FAILED)
+append_if(CXX_SUPPORTS_WNO_PASS_FAILED "-Wno-pass-failed" CMAKE_CXX_FLAGS)
+
# Installing the headers and docs needs to depend on generating any public
# tablegen'd targets.
# mlir-generic-headers are dialect-independent.
More information about the Mlir-commits
mailing list