-
Notifications
You must be signed in to change notification settings - Fork 5.3k
JIT: Remove BBF_RUN_RARELY
#118147
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
JIT: Remove BBF_RUN_RARELY
#118147
Conversation
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 removes the BBF_RUN_RARELY flag from the JIT compiler and replaces its functionality by comparing the block's execution weight to BB_ZERO_WEIGHT. This simplifies the codebase by eliminating redundant flag management while maintaining the same logical behavior for identifying rarely-run blocks.
Key changes:
- Remove
BBF_RUN_RARELYflag definition and all its usages - Update
isRunRarely()method to checkbbWeight == BB_ZERO_WEIGHTinstead of the flag - Remove flag maintenance code that synchronized
BBF_RUN_RARELYwith zero weights - Introduce
bbSetRunRarely()method calls where appropriate
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/block.h | Removes BBF_RUN_RARELY flag definition, updates isRunRarely() implementation, removes flag synchronization in weight-setting methods |
| src/coreclr/jit/optimizer.cpp | Removes BBF_RUN_RARELY flag removal/setting code in weight management functions |
| src/coreclr/jit/importer.cpp | Replaces explicit weight and flag setting with bbSetRunRarely() call and removes flag copying |
| src/coreclr/jit/fgprofile.cpp | Removes flag synchronization when setting block weights |
| src/coreclr/jit/fgopt.cpp | Updates profile weight checks to use method calls instead of flag checks, removes flag setting |
| src/coreclr/jit/fginline.cpp | Removes BBF_RUN_RARELY exclusion when copying block flags |
| src/coreclr/jit/fgdiagnostic.cpp | Removes BBF_RUN_RARELY from debug output and validation |
| src/coreclr/jit/block.cpp | Removes BBF_RUN_RARELY from debug flag display |
| src/coreclr/jit/async.cpp | Replaces weight inheritance with direct bbSetRunRarely() call |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…alid/runtime into remove-bbf-run-rarely
|
@dotnet/jit-contrib PTAL. No diffs. Thanks! |
Since every block is expected to have an execution count, compare this count to
BB_ZERO_WEIGHTto determine if the block is rarely-run rather than maintaining a flag to indicate it. Fixes #48778.