Skip to content

(0.51) Add missing edge in block splitter - #222

Merged
vijaysun-omr merged 1 commit into
eclipse-openj9:v0.51.0-releasefrom
a7ehuo:v0.51.0-fix-block-splitter-missing-edge
Mar 7, 2025
Merged

vijaysun-omr merged 1 commit into
eclipse-openj9:v0.51.0-releasefrom
a7ehuo:v0.51.0-fix-block-splitter-missing-edge

Conversation

@a7ehuo

@a7ehuo a7ehuo commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

cherry pick eclipse-omr/omr#7680


There is a case where before block splitter, the merge block is the original fall-through block of the split block and it is also the split block's branch destination. In this case, there is only one edge from the split block to the merge block.

--- Before block splitter ---
BBStart <block_1>  (splitPred)
   ificmpeq ------> block_2

BBStart <block_2>  (mergeNode)

As part of the block splitter transformation, it removes the edge from the split block to its original branch destination. It reverses the split block's branch destination to its original fall-through block. In this case the new branch destination is the same as the original branch destination, but the edge between them is now missing.

We need to create the edge if it doesn't exist.

--- After block splitter  ---
BBStart <block_1>  (splitPred)
   ificmpne -----> block_2     // branch reversed

BBStart <block_3> (cloneStart)

BBStart <block_4> (cloneEnd)

BBStart <block_2> (mergeNode)

Fixes: eclipse-openj9/openj9#21030

There is a case where before block splitter, the merge block
is the original fall-through block of the split block and it
is also the split block's branch destination. In this case,
there is only one edge from the split block to the merge block.

--- Before block splitter ---
BBStart <block_1>  (splitPred)
   ificmpeq ------> block_2

BBStart <block_2>  (mergeNode)

As part of the block splitter transformation, it removes the edge
from the split block to its original branch destination. It reverses
the split block's branch destination to its original fall-through
block. In this case the new branch destination is the same as the
original branch destination, but the edge between them is now missing.

We need to create the edge if it doesn't exist.

--- After block splitter  ---
BBStart <block_1>  (splitPred)
   ificmpne -----> block_2     // branch reversed

BBStart <block_3> (cloneStart)

BBStart <block_4> (cloneEnd)

BBStart <block_2> (mergeNode)
-----------------------------

Fixes: eclipse-openj9/openj9#21030
Signed-off-by: Annabelle Huo <Annabelle.Huo@ibm.com>
@a7ehuo
a7ehuo requested a review from vijaysun-omr as a code owner March 7, 2025 15:40
@a7ehuo a7ehuo changed the title Add missing edge in block splitter (v0.51) Add missing edge in block splitter Mar 7, 2025
@a7ehuo a7ehuo changed the title (v0.51) Add missing edge in block splitter (0.51) Add missing edge in block splitter Mar 7, 2025
@a7ehuo

a7ehuo commented Mar 7, 2025

Copy link
Copy Markdown
Contributor Author

@pshipton @vijaysun-omr fyi

@vijaysun-omr
vijaysun-omr merged commit f73de11 into eclipse-openj9:v0.51.0-release Mar 7, 2025
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.

2 participants