Skip to content

Conversation

amanasifkhalid
Copy link
Contributor

Follow-up to #103319 (comment). @jakobbotsch PTAL, thank you!

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 12, 2024
@amanasifkhalid
Copy link
Contributor Author

/azp run runtime-coreclr jitstress

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines 4316 to 4322
#ifdef DEBUG
if (comp->compStressCompile(Compiler::STRESS_SKIP_COND_NODE_LOWERING, 50))
{
JITDUMP("JitStress: skip lowering attempt\n");
return false;
}
#endif // DEBUG
Copy link
Member

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).

Copy link
Contributor Author

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.

@amanasifkhalid
Copy link
Contributor Author

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?

@jakobbotsch
Copy link
Member

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?)

@amanasifkhalid amanasifkhalid added this to the 10.0.0 milestone Aug 12, 2024
@Copilot Copilot AI review requested due to automatic review settings August 5, 2025 19:50
Copy link
Contributor

@Copilot Copilot AI left a 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

@amanasifkhalid
Copy link
Contributor Author

/azp run runtime-coreclr jitstress

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@amanasifkhalid
Copy link
Contributor Author

/azp run runtime-coreclr jitstress

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants