Repository navigation
JIT: add JitEnablePhaseChecks, and disable it for the base SuperPMI asm diffs JIT - #132822
Conversation
…sm diffs JIT The baseline JIT is already validated, so re-running the phase IR checks on it during asm diffs is unnecessary. Add a JitEnablePhaseChecks config and turn it off for the base JIT. It stays on for the diff JIT, which is the one under test. Add -full_ir_checks to asmdiffs to run them in the base JIT as well, and -no_ir_checks to replay, asmdiffs, tpdiff and metricdiff to turn them off everywhere. tpdiff and metricdiff only ever configure both JITs the same way, since they compare the base against the diff. The asm diffs CI pipeline passes -full_ir_checks. The diff artifact runs are left alone: --diff_jit_dump compares the base and diff JitDumps textually and the checks are visible there, so both sides have to be configured identically. asmdiffs over benchmarks.run_pgo (92,134 contexts, min of 3): -full_ir_checks 12.23s default 10.88s (-11.0%) -no_ir_checks 9.57s (-21.8%) Co-authored-by: Copilot <[email protected]> Copilot-Session: 064035bf-fb1f-450e-afd2-08a7700aa736
|
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. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
PTAL @dotnet/jit-contrib |
|
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. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new JIT config knob (JitEnablePhaseChecks) to allow disabling post-phase IR/graph validation checks in selected SuperPMI scenarios (notably the base JIT during asm diffs), while keeping checks enabled for the diff JIT under test. It also adds command-line switches to control this behavior from superpmi.py and wires the asm-diffs pipeline to run with full checks when desired.
Changes:
- Add
JitEnablePhaseChecksJIT config and gate post-phase checks on it. - Extend
superpmi.pywith-full_ir_checks/-no_ir_checksand passJitEnablePhaseChecks=0to the appropriate JIT(s). - Update
superpmi_diffs.pyto invoke asm diffs with-full_ir_checks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/coreclr/scripts/superpmi.py | Adds CLI switches and threads JitEnablePhaseChecks through SuperPMI replay/asmdiffs/tpdiff/metricdiff. |
| src/coreclr/scripts/superpmi_diffs.py | Ensures asm-diffs runs use -full_ir_checks (pipeline behavior). |
| src/coreclr/jit/phase.cpp | Gates post-phase validation checks behind JitEnablePhaseChecks. |
| src/coreclr/jit/jitconfigvalues.h | Defines the new JitEnablePhaseChecks config value. |
Verify no_ir_checks in the collect branch of setup_args. collect does a replay internally when verifying the final MCH, but it does not call verify_replay_common_args(), so reading the arg raised an AttributeError. Apply -no_ir_checks to the diff artifact runs as well. It is documented as turning the checks off everywhere, but it only reached the main asmdiffs replay. It applies to both JITs, so it keeps the base and diff artifact runs configured identically, which the textual JitDump comparison requires. The asymmetric default still cannot be passed along there. Set the option with -jitoption/-jit2option force so it overrides any value recorded in the method context. Co-authored-by: Copilot <[email protected]> Copilot-Session: 42b3ef5b-567c-4da1-a6d1-1fe8e860a52b
There was a problem hiding this comment.
🟡 Changes recommended
There are correctness/documentation mismatches in the new flag semantics (including conflicting-option precedence) and a repro-command mismatch that should be fixed before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (5)
Previously missed (2) — in code that hasn't changed since the last review.
src/coreclr/scripts/superpmi.py:5746
- The warning for specifying both
-full_ir_checksand-no_ir_checkscurrently ignores-no_ir_checks, but the option's help and comments describe-no_ir_checksas disabling checks everywhere. Either make the options mutually exclusive (error) or have-no_ir_checkstake precedence (e.g., ignore-full_ir_checks).
src/coreclr/scripts/superpmi.py:351 - The new
JitEnablePhaseChecksknob gates all post-phase checks (flow graph, loops, uniqueness, profile, IR, etc.), not just IR checks. The-no_ir_checkshelp text is misleading; it should describe disabling post-phase checks rather than only "phase IR checks".
This issue also appears in the following locations of the same file:
- line 380
- line 2216
src/coreclr/scripts/superpmi.py:380
- Similar to
-no_ir_checks,-full_ir_checkscontrolsJitEnablePhaseChecks, which gates all post-phase checks, not only IR checks. The help text should avoid calling these "phase IR checks" to prevent confusion about what is being disabled/enabled.
asm_diff_parser.add_argument("-full_ir_checks", action="store_true", help="Run the phase IR checks in the base JIT as well. By default they are only run in the diff JIT, since the base JIT is already validated.")
src/coreclr/jit/jitconfigvalues.h:199
- The
JitEnablePhaseChecksconfig gates all post-phase checks (not only IR checks). The comment should reflect that broader scope so it's clear what behavior this config controls.
CONFIG_INTEGER(JitEnablePhaseChecks, "JitEnablePhaseChecks", 1) // Run the phase IR checks
src/coreclr/scripts/superpmi.py:2220
- This comment block repeatedly refers to "phase IR checks", but the new
JitEnablePhaseCheckstoggle actually gates all post-phase checks, not only IR. Updating the wording here will help prevent misunderstandings about what the new flags/config control.
# The base JIT is already validated, so the phase IR checks are turned off for it by
# default and left on for the diff JIT, which is the one under test. -full_ir_checks
# turns them back on for the base JIT, and -no_ir_checks turns them off everywhere.
#
# The diff artifact runs compare the base and diff JitDumps textually, so the checks
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
…d line The option was appended to common_flags after repro_flags had been merged in, so the repro command line saved for failures did not reflect the actual invocation. It changes what the JIT does, so put it in repro_flags instead. Co-authored-by: Copilot <[email protected]> Copilot-Session: 42b3ef5b-567c-4da1-a6d1-1fe8e860a52b
There was a problem hiding this comment.
🟡 Changes recommended
Some newly added help text/comments mischaracterize the scope of what’s disabled (not only IR checks) and one warning uses print() instead of logging, reducing clarity/diagnostic consistency.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (4)
Previously missed (1) — in code that hasn't changed since the last review.
src/coreclr/scripts/superpmi.py:5748
- This warning currently uses print(), which bypasses the script's logging configuration (log file, timestamps, etc.). Using logging.warning keeps output consistent with other warnings in this script.
src/coreclr/scripts/superpmi.py:380
- -full_ir_checks is described as enabling "phase IR checks" in the base JIT, but JitEnablePhaseChecks actually gates all post-phase checks controlled by activePhaseChecks (not only IR). Updating the option help text to match the actual behavior will make this flag clearer.
asm_diff_parser.add_argument("-full_ir_checks", action="store_true", help="Run the phase IR checks in the base JIT as well. By default they are only run in the diff JIT, since the base JIT is already validated.")
src/coreclr/scripts/superpmi.py:2222
- This comment block uses the term "phase IR checks", but the new JitEnablePhaseChecks gating affects all post-phase checks driven by activePhaseChecks. Consider updating the terminology here to avoid implying only IR validation is affected.
# The base JIT is already validated, so the phase IR checks are turned off for it by
# default and left on for the diff JIT, which is the one under test. -full_ir_checks
# turns them back on for the base JIT, and -no_ir_checks turns them off everywhere.
#
# The diff artifact runs compare the base and diff JitDumps textually, so the checks
src/coreclr/jit/jitconfigvalues.h:199
- The comment for JitEnablePhaseChecks says "phase IR checks", but the gating in Phase::PostPhase controls all post-phase checks (flowgraph/EH/loops/profile/etc.). Consider tweaking the comment to reflect the broader scope.
CONFIG_INTEGER(JitEnablePhaseChecks, "JitEnablePhaseChecks", 1) // Run the phase IR checks
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
|
PTAL @dotnet/jit-contrib |
The baseline JIT is already validated, so re-running the phase IR checks on it during asm diffs is unnecessary. Add a JitEnablePhaseChecks config and turn it off for the base JIT. It stays on for the diff JIT, which is the one under test.
Add -full_ir_checks to asmdiffs to run them in the base JIT as well, and -no_ir_checks to replay, asmdiffs, tpdiff and metricdiff to turn them off everywhere. tpdiff and metricdiff only ever configure both JITs the same way, since they compare the base against the diff. The asm diffs CI pipeline passes -full_ir_checks.
The diff artifact runs are left alone: --diff_jit_dump compares the base and diff JitDumps textually and the checks are visible there, so both sides have to be configured identically.
asmdiffs over benchmarks.run_pgo (92,134 contexts, min of 3):
-full_ir_checks 12.23s
default 10.88s (-11.0%)
-no_ir_checks 9.57s (-21.8%)