Reset compiler flags after completing intrinsic tests#2082
Conversation
WalkthroughReset Changes
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmake/detect-intrinsics.cmake (1)
604-627: Same issue exists incheck_ssse3_intrinsicsmacro.This macro sets
CMAKE_REQUIRED_FLAGSat line 617 but is missing the reset beforeendmacro(). The SSSE3 flags will leak into subsequent checks (starting withcheck_sse41_intrinsics).🔧 Proposed fix
HAVE_SSSE3_INTRIN ) + set(CMAKE_REQUIRED_FLAGS) endmacro()
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cmake/detect-intrinsics.cmake
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: KungFuJesus
Repo: zlib-ng/zlib-ng PR: 1872
File: arch/x86/x86_intrins.h:114-117
Timestamp: 2025-02-23T16:51:54.545Z
Learning: In x86/x86_intrins.h, the Clang macros for _mm_cvtsi64x_si128 and _mm_cvtsi128_si64x don't need additional MSVC guards since MSVC's implementation is already protected by `defined(_MSC_VER) && !defined(__clang__)`, making them mutually exclusive.
Learnt from: KungFuJesus
Repo: zlib-ng/zlib-ng PR: 1805
File: inffast_tpl.h:257-262
Timestamp: 2024-10-29T02:22:52.846Z
Learning: In `inffast_tpl.h`, when AVX512 is enabled, the branch involving `chunkcopy_safe` is intentionally eliminated to optimize performance.
📚 Learning: 2025-02-23T16:51:54.545Z
Learnt from: KungFuJesus
Repo: zlib-ng/zlib-ng PR: 1872
File: arch/x86/x86_intrins.h:114-117
Timestamp: 2025-02-23T16:51:54.545Z
Learning: In x86/x86_intrins.h, the Clang macros for _mm_cvtsi64x_si128 and _mm_cvtsi128_si64x don't need additional MSVC guards since MSVC's implementation is already protected by `defined(_MSC_VER) && !defined(__clang__)`, making them mutually exclusive.
Applied to files:
cmake/detect-intrinsics.cmake
📚 Learning: 2025-10-08T18:04:33.839Z
Learnt from: mtl1979
Repo: zlib-ng/zlib-ng PR: 1977
File: cmake/detect-intrinsics.cmake:142-180
Timestamp: 2025-10-08T18:04:33.839Z
Learning: MSVC Visual Studio version 18.0.0 (build 11018.127) and later supports the AVX2-VNNI intrinsic _mm256_dpbusd_epi32 via zmmintrin.h header and can compile it with /arch:AVX2 flag.
Applied to files:
cmake/detect-intrinsics.cmake
📚 Learning: 2024-10-29T02:22:52.846Z
Learnt from: KungFuJesus
Repo: zlib-ng/zlib-ng PR: 1805
File: inffast_tpl.h:257-262
Timestamp: 2024-10-29T02:22:52.846Z
Learning: In `inffast_tpl.h`, when AVX512 is enabled, the branch involving `chunkcopy_safe` is intentionally eliminated to optimize performance.
Applied to files:
cmake/detect-intrinsics.cmake
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: macOS GCC UBSAN (ARM64)
- GitHub Check: macOS GCC UBSAN (ARM64)
- GitHub Check: macOS GCC UBSAN (ARM64)
- GitHub Check: macOS GCC UBSAN (ARM64)
- GitHub Check: macOS GCC UBSAN (ARM64)
- GitHub Check: macOS GCC UBSAN (ARM64)
- GitHub Check: macOS GCC UBSAN (ARM64)
- GitHub Check: macOS GCC UBSAN (ARM64)
- GitHub Check: macOS GCC UBSAN (ARM64)
- GitHub Check: macOS GCC UBSAN (ARM64)
🔇 Additional comments (1)
cmake/detect-intrinsics.cmake (1)
174-174: Critical fix: Prevents AVX512 flags from leaking into subsequent checks.This correctly resets
CMAKE_REQUIRED_FLAGSafter the AVX512 intrinsics check, matching the pattern used in all other intrinsics check macros. Without this reset, the AVX512 flags would persist and contaminate subsequent intrinsics detection, potentially causing false results or compilation errors.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2082 +/- ##
===========================================
+ Coverage 81.39% 82.69% +1.30%
===========================================
Files 168 168
Lines 13323 13323
Branches 3322 3322
===========================================
+ Hits 10844 11018 +174
+ Misses 1487 1313 -174
Partials 992 992 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5338c9a to
523982c
Compare
avoids the next test inheriting the previous flags.
523982c to
2c17bc8
Compare
Add missing reset of compiler flags after completing a test, avoids the next test inheriting the previous flags.