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

Do not continue to merge back cold path if guard2 block has been removed #7297

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

a7ehuo
Copy link
Contributor

@a7ehuo a7ehuo commented Mar 28, 2024

changeBranchDestination tries to remove unreachable blocks after the
removal of the old edge from guard2 to cold2. Rarely, a previous
transformation in this pass could have made guard2Block unreachable
without removing it, in which case it might have been removed just now.
Normally, if all relevant blocks are removed, later moveBlockAfterDest
will not cause any issue since it will be just moving around all
unreachable blocks. However, in an even more rare case, if some of the
blocks are removed and some of them are not (eg, guard2Block and the
previous block of guard2Block are removed but the next block of
guard2Block is still valid), moveBlockAfterDest could end up joining
an invalid/removed block with a valid block. Therefore, if guard2Block
is no longer valid, it should not proceed.

Fixes: eclipse-openj9/openj9#18873

@a7ehuo a7ehuo requested review from jdmpapin and removed request for vijaysun-omr March 28, 2024 13:35
@a7ehuo
Copy link
Contributor Author

a7ehuo commented Mar 28, 2024

@jdmpapin May I ask you to review this change? Thank you very much in advance! This comment gives a detailed example of the problem this PR fixes.

@hzongaro fyi

`changeBranchDestination` tries to remove unreachable blocks after the
removal of the old edge from guard2 to cold2. Rarely, a previous
transformation in this pass could have made guard2Block unreachable
without removing it, in which case it might have been removed just now.
Normally, if all relevant blocks are removed, later `moveBlockAfterDest`
will not cause any issue since it will be just moving around all
unreachable blocks. However, in an even more rare case, if some of the
blocks are removed and some of them are not (eg, guard2Block and the
previous block of guard2Block are removed but the next block of
guard2Block is still valid), `moveBlockAfterDest` could end up joining
an invalid/removed block with a valid block. Therefore, if guard2Block
is no longer valid, it should not proceed.

Fixes: eclipse-openj9/openj9#18873

Signed-off-by: Annabelle Huo <Annabelle.Huo@ibm.com>
@jdmpapin
Copy link
Contributor

jdmpapin commented Apr 3, 2024

The mac failure is #7181

Jenkins build all

@jdmpapin
Copy link
Contributor

jdmpapin commented Apr 3, 2024

Everything has passed except for the known mac failure already mentioned

@jdmpapin jdmpapin merged commit 8037ccd into eclipse:master Apr 3, 2024
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash vmState=0x000522ff
2 participants