-
Notifications
You must be signed in to change notification settings - Fork 5.1k
JIT: Add stress mode for skipping lowering conditional nodes to use CPU flags #103358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
/azp run runtime-coreclr jitstress |
Azure Pipelines successfully started running 1 pipeline(s). |
src/coreclr/jit/lower.cpp
Outdated
#ifdef DEBUG | ||
if (comp->compStressCompile(Compiler::STRESS_SKIP_COND_NODE_LOWERING, 50)) | ||
{ | ||
JITDUMP("JitStress: skip lowering attempt\n"); | ||
return false; | ||
} | ||
#endif // DEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
50% of methods seems a bit high given the frequency of conditional branches.. maybe something like 10% is sufficient?
Nit: the ifdef
is unnecessary, there is a release version of compStressCompile
that always returns false (but feel free to leave it if you prefer to make it more visible that this is debug-only).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I'll update it.
This seems to have exposed some asserts in LSRA -- @jakobbotsch should we address these in a separate PR, or here so we don't block outerloop CI? |
I think we need to address it first. Maybe just open an issue with instructions about how to reproduce this (does it repro readily with DOTNET_JitStress enabled spmi replay on this PR?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new JIT stress mode that prevents the lowering of conditional nodes to use CPU flags. This is a testing/debugging feature that allows developers to stress test the JIT compiler by forcing it to skip an optimization path where conditions are lowered to directly use CPU flags.
Key changes:
- Adds a new stress mode
STRESS_SKIP_COND_NODE_LOWERING
to the compiler's stress testing framework - Implements early return logic in the condition lowering function when this stress mode is active
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/coreclr/jit/compiler.h | Adds new STRESS_SKIP_COND_NODE_LOWERING stress mode definition with descriptive comment |
src/coreclr/jit/lower.cpp | Implements stress mode check that skips conditional node lowering when active |
/azp run runtime-coreclr jitstress |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-coreclr jitstress |
Azure Pipelines successfully started running 1 pipeline(s). |
Follow-up to #103319 (comment). @jakobbotsch PTAL, thank you!