Skip to content

JIT: turn MEASURE_NOWAY off by default - #132625

Merged
jakobbotsch merged 2 commits into
dotnet:mainfrom
jakobbotsch:jit-disable-measure-noway
Aug 24, 2026
Merged

jakobbotsch merged 2 commits into
dotnet:mainfrom
jakobbotsch:jit-disable-measure-noway

Conversation

@jakobbotsch

Copy link
Copy Markdown
Member

MEASURE_NOWAY was enabled in every DEBUG build, expanding every noway_assert to an unconditional out-of-line RecordNowayAssertGlobal call that immediately returns because JitMeasureNowayAssert defaults to 0. Require it to be defined to 1 manually when measuring instead.

Checked JIT instructions retired:

benchmarks.run -3.75%
benchmarks.run_pgo -3.65%
benchmarks.run_pgo_optrepeat -3.75%
libraries.pmi -3.63%

benchmarks.run replay wall clock: 67.38s -> 65.59s (-2.66%).

MEASURE_NOWAY was enabled in every DEBUG build, expanding every
noway_assert to an unconditional out-of-line RecordNowayAssertGlobal
call that immediately returns because JitMeasureNowayAssert defaults to
0. Require it to be defined to 1 manually when measuring instead.

Checked JIT instructions retired:

  benchmarks.run                -3.75%
  benchmarks.run_pgo            -3.65%
  benchmarks.run_pgo_optrepeat  -3.75%
  libraries.pmi                 -3.63%

benchmarks.run replay wall clock: 67.38s -> 65.59s (-2.66%).

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 064035bf-fb1f-450e-afd2-08a7700aa736
Copilot AI lite review requested due to automatic review settings August 21, 2026 14:41
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 21, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 changes the JIT’s MEASURE_NOWAY feature so it is disabled by default even in DEBUG builds, avoiding unconditional RecordNowayAssertGlobal instrumentation in every noway_assert expansion unless explicitly enabled for measurement scenarios.

Changes:

  • Update MEASURE_NOWAY to default to 0 unless explicitly defined, including in DEBUG builds.
  • Clarify JitMeasureNowayAssert / JitMeasureNowayAssertFile config comments to reflect that measurement requires MEASURE_NOWAY to be defined to 1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/coreclr/jit/jitconfigvalues.h Updates config documentation to clarify MEASURE_NOWAY must be defined to 1 for noway-assert measurement options.
src/coreclr/jit/error.h Changes MEASURE_NOWAY defaulting behavior so it is off by default (including DEBUG), reducing noway_assert expansion bloat unless explicitly enabled.

Comment thread src/coreclr/jit/error.h Resolved
Comment thread src/coreclr/jit/error.h Resolved
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 064035bf-fb1f-450e-afd2-08a7700aa736
Copilot AI review requested due to automatic review settings August 21, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@jakobbotsch

Copy link
Copy Markdown
Member Author

PTAL @dotnet/jit-contrib

@jakobbotsch
jakobbotsch requested a review from a team August 21, 2026 15:39
@jakobbotsch

Copy link
Copy Markdown
Member Author

/ba-g Build analysis is blocking because of dotnet/arcade#17340

@jakobbotsch
jakobbotsch merged commit e0df9da into dotnet:main Aug 24, 2026
126 of 128 checks passed
@jakobbotsch
jakobbotsch deleted the jit-disable-measure-noway branch August 24, 2026 11:56
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Aug 25, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

3 participants