[AIROCMLIR-939] Fix dead -Wno-c++98-compat-extra-semi suppression#2402
[AIROCMLIR-939] Fix dead -Wno-c++98-compat-extra-semi suppression#2402bogdan-petkovic wants to merge 13 commits into
Conversation
Signed-off-by: bogdan-petkovic <bpetkovi@amd.com>
…ExecutionEngine Signed-off-by: bogdan-petkovic <bpetkovi@amd.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a typo in CMake guard variables so the -Wno-c++98-compat-extra-semi warning suppression is actually applied when the compiler supports it, matching how the adjacent check_cxx_compiler_flag()-guarded suppressions already work.
Changes:
- Correct
if()conditions to checkCXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG(the variable set bycheck_cxx_compiler_flag) instead of the never-setCXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG. - Apply the same fix in rocMLIR-owned CMake plus two locations in the vendored LLVM MLIR ExecutionEngine CMake.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| mlir/tools/rocmlir-tuning-driver/CMakeLists.txt | Fixes the guard variable so mlir_rocm_runtime receives -Wno-c++98-compat-extra-semi when supported. |
| external/llvm-project/mlir/lib/ExecutionEngine/CMakeLists.txt | Fixes the same dead guard for mlir_rocm_runtime and obj.MLIRRocmExecutionEngineUtils so the suppression is applied when supported. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Verdict: APPROVE -- submitted as COMMENT (automated reviews are advisory) · Findings: 0 (0 Critical, 0 Major, 0 Minor)
Scope
Fixes a variable-name typo that made the -Wno-c++98-compat-extra-semi warning suppression dead code at three CMake sites: external/llvm-project/mlir/lib/ExecutionEngine/CMakeLists.txt:424 and :467, and mlir/tools/rocmlir-tuning-driver/CMakeLists.txt:48. The guarding if() now reads the same CXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG that check_cxx_compiler_flag actually sets.
Findings
No blocking issues found.
Notes
- Diff is minimal and surgical — three identical one-token renames, all from the never-set name to the actually-set name. Verified the
check_cxx_compiler_flagcalls immediately above each site writeCXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG, so the guards now match. - Sibling suppressions in the same files (
-Wno-return-type-c-linkage,-Wno-nested-anon-types,-Wno-gnu-anonymous-struct) already use matching names, confirming the intended pattern. - The
external/change is correctly isolated in its own[EXTERNAL]-prefixed commit (db30ea81b), separate from the rocMLIR-side commit (1ad6c33b4), per the checklist's Major rule about not mixingexternal/with rocMLIR changes. - Config-only change; no runtime behavior impact in the default build. The suppression only matters under
-Wc++98-compat/-Weverything, where it now actually applies. - The
external/line 424 block mirrors the same typo in upstream LLVMmain; an upstream fix is out of scope here but worth flagging to upstream separately.
CI status
All non-pending checks are passing at review time; premerge C/C++, Python lint, and Python perf jobs are still in progress. No fail/cancel buckets observed.
…mpat-extra-semi-suppression
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2402 +/- ##
===========================================
+ Coverage 82.57% 82.65% +0.09%
===========================================
Files 120 120
Lines 42852 42852
Branches 7110 7110
===========================================
+ Hits 35381 35418 +37
+ Misses 4815 4811 -4
+ Partials 2656 2623 -33
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…mpat-extra-semi-suppression
…mpat-extra-semi-suppression
…mpat-extra-semi-suppression
…mpat-extra-semi-suppression
…mpat-extra-semi-suppression
…mpat-extra-semi-suppression
…mpat-extra-semi-suppression
…mpat-extra-semi-suppression
…mpat-extra-semi-suppression
Can we create upstream PR to fix this ? |
| check_cxx_compiler_flag(-Wno-c++98-compat-extra-semi | ||
| CXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG) | ||
| if (CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG) | ||
| if (CXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG) |
There was a problem hiding this comment.
better to create upstream PR
There was a problem hiding this comment.
I've opened an upstream PR for the same fix in llvm/llvm-project: llvm/llvm-project#204524 Note that this rocMLIR PR is independent of the upstream one, it also fixes the rocMLIR-added block (line 467) and the rocmlir-tuning-driver CMake, and it keeps our vendored copy correct regardless of when the upstream change lands. So I don't think we need to block on upstream. What do you think @umangyadav, OK to merge this one now?
…mpat-extra-semi-suppression
Motivation
A variable-name typo made the
-Wno-c++98-compat-extra-semisuppression dead code.check_cxx_compiler_flagstores its result inCXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG(with_NO_), but the guardingif()checkedCXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG(without_NO_), which is never set. The condition was always false, so the flag was never applied. The three sibling blocks (-Wno-return-type-c-linkage,-Wno-nested-anon-types,-Wno-gnu-anonymous-struct) use matching names and work correctly.Originally flagged by
rocmlir-pr-reviewer[bot]on #2356 (https://github.com/ROCm/rocMLIR/pull/2402#issue-4613195205).Technical Details
Fixed the
if()guards to read the variable that is actually set (CXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG) in three places:mlir/tools/rocmlir-tuning-driver/CMakeLists.txt:48(rocMLIR-owned).external/llvm-project/mlir/lib/ExecutionEngine/CMakeLists.txt:424and:467([EXTERNAL]commit). Line 424 mirrors the same bug present in upstream LLVMmain; line 467 is a rocMLIR-added block.Config-only change. No functional impact in the default build (the warning is only emitted under
-Wc++98-compat/-Weverything); the fix ensures the suppression actually applies when those warnings are enabled onmlir_rocm_runtime/obj.MLIRRocmExecutionEngineUtils.Test Plan
Test Result
check_cxx_compiler_flagresults are now consumed by a matchingif(); the previously dead suppression is live.Submission Checklist