Skip to content
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: Allow initializing blocks without jump targets #93928

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

amanasifkhalid
Copy link
Member

...and remove BasicBlock::bbTempJumpDest, per discussion here in #93415. We still assert the jump target is set appropriately whenever it is read/written, and in the majority of cases, we still initialize blocks with their jump kind and target set simultaneously. This change improves usability for the few edge cases (like in Compiler::impImportLeave) where a block's jump target isn't known at initialization.

@ghost ghost assigned amanasifkhalid Oct 24, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 24, 2023
@ghost
Copy link

ghost commented Oct 24, 2023

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

Issue Details

...and remove BasicBlock::bbTempJumpDest, per discussion here in #93415. We still assert the jump target is set appropriately whenever it is read/written, and in the majority of cases, we still initialize blocks with their jump kind and target set simultaneously. This change improves usability for the few edge cases (like in Compiler::impImportLeave) where a block's jump target isn't known at initialization.

Author: amanasifkhalid
Assignees: amanasifkhalid
Labels:

area-CodeGen-coreclr

Milestone: -

@amanasifkhalid amanasifkhalid changed the title Allow initializing blocks without jump targets JIT: Allow initializing blocks without jump targets Oct 24, 2023
@amanasifkhalid
Copy link
Member Author

amanasifkhalid commented Oct 24, 2023

CC @dotnet/jit-contrib, @AndyAyersMS @jakobbotsch PTAL. I decided to implement Jakob's suggestion of not doing checks during block initialization, and instead performing them when reading/writing the block's jump target. To do this, I had to refactor Compiler::bbNewBasicBlock to be part of the BasicBlock struct so it can directly modify the jump target members without using the modifier methods that contain asserts.

No diffs.

@amanasifkhalid
Copy link
Member Author

Failure looks like #48798

@AndyAyersMS
Copy link
Member

Looks ok to me, but I'll let @jakobbotsch approve if he's ok with this.

Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

LGTM. Nit: now that the function is part of BasicBlock you might consider just naming it BasicBlock::New or something of the sort (and if you decide to do that, feel free to do it in a follow-up to avoid rerunning CI again)

@amanasifkhalid
Copy link
Member Author

(and if you decide to do that, feel free to do it in a follow-up to avoid rerunning CI again)

I'll include the rename in the next PR. Thanks!

@amanasifkhalid amanasifkhalid merged commit fe043b4 into dotnet:main Oct 24, 2023
127 of 129 checks passed
@amanasifkhalid amanasifkhalid deleted the bbj_uninit branch October 24, 2023 22:20
liveans pushed a commit to liveans/dotnet-runtime that referenced this pull request Nov 9, 2023
...and remove BasicBlock::bbTempJumpDest, per discussion in dotnet#93415. We still assert the jump target is set appropriately whenever it is read/written, and in the majority of cases, we still initialize blocks with their jump kind and target set simultaneously. This change improves usability for the few edge cases (like in Compiler::impImportLeave) where a block's jump target isn't known at initialization.
@ghost ghost locked as resolved and limited conversation to collaborators Nov 24, 2023
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