Remove -Wno-unused-function -Wno-tautological-compare -Wno-unused-value for clrjit projects#128271
Remove -Wno-unused-function -Wno-tautological-compare -Wno-unused-value for clrjit projects#128271EgorBo wants to merge 7 commits into
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Pull request overview
Re-enables -Wunused-function for the JIT (by removing the repo-wide -Wno-unused-function for this directory on Unix/WASI) and fixes the warnings that surfaced. This includes guarding several helpers with the same #ifdef conditions as their callers, deleting a truly unused overload, and incidentally repairing two bugs (a missing assignment and a discarded expression) that the warning exposed.
Changes:
- Enable
-Wunused-functionfor clrjit targets via a new block insrc/coreclr/jit/CMakeLists.txt. - Guard target/DEBUG-only helpers (
RelopEvaluationResultString,TryGetStoreCoalescingConstantBits,MatchIntConstSelectValues/IntConstSelectOper,isLowSimdReg) with matching#ifdefs, and delete the unusedCorInfoType-takingisSupportedBaseTypeoverload. - Fix two latent bugs uncovered by the warning: a missing
id =assignment inGetHWIntrinsicIdForCmpOp(GT_GT/isScalar/xarch path) and discardedimpPopStack().valexpressions inimpIntrinsic.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/CMakeLists.txt | Strip -Wno-unused-function from the JIT directory's compile options on Unix/WASI. |
| src/coreclr/jit/scev.cpp | Wrap debug-only RelopEvaluationResultString in #ifdef DEBUG. |
| src/coreclr/jit/lower.cpp | Guard TryGetStoreCoalescingConstantBits for TARGET_XARCH/TARGET_ARM64. |
| src/coreclr/jit/ifconversion.cpp | Guard IntConstSelectOper/MatchIntConstSelectValues for TARGET_RISCV64. |
| src/coreclr/jit/emitxarch.cpp | Wrap debug-only isLowSimdReg in #ifdef DEBUG. |
| src/coreclr/jit/hwintrinsic.cpp | Remove unused CorInfoType-overload of isSupportedBaseType; remaining var_types overload is the one used at all call sites. |
| src/coreclr/jit/gentree.cpp | Fix missing id = assignment in scalar GT_GT case in GetHWIntrinsicIdForCmpOp. |
| src/coreclr/jit/importercalls.cpp | Replace impPopStack().val; no-op statements with impPopStack();. |
|
PTAL @dotnet/jit-contrib minor cleanup, I'll do the clean up for unused vars separately as it emits too many changes (and probably will not remove that flag for variables) |
| else if (isScalar) | ||
| { | ||
| reverseCond ? NI_X86Base_CompareScalarNotLessThanOrEqual : NI_X86Base_CompareScalarGreaterThan; | ||
| id = reverseCond ? NI_X86Base_CompareScalarNotLessThanOrEqual : NI_X86Base_CompareScalarGreaterThan; |
There was a problem hiding this comment.
apparently, this was a bug
Co-authored-by: Copilot <[email protected]>
We currently define the followings for the entire native code:
my initial attempt to remove them all led to a very big diff so I decided to focus on JIT first.