[Mlir-commits] [mlir] [MLIR][CMake] Suppress -Wpass-failed warning (PR #160472)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Sep 24 01:58:25 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Nikita Popov (nikic)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/160472.diff


1 Files Affected:

- (modified) mlir/CMakeLists.txt (+6) 


``````````diff
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.

``````````

</details>


https://github.com/llvm/llvm-project/pull/160472


More information about the Mlir-commits mailing list