RFR: 8325478: Restructure the macro expansion compiler phase to not include macro elimination [v2]

Saranya Natarajan snatarajan at openjdk.org
Wed Jun 25 08:48:31 UTC 2025


On Wed, 18 Jun 2025 16:22:24 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:

>> This placement of ` refine_strip_mined_loop_macro_nodes()` is ok as it only affects the functionality in the loop of the `eliminate_opaque_looplimit_macro_nodes` method.
>
> Could you elaborate a bit on why this is the case? Just looking briefly at `OuterStripMinedLoopNode::adjust_strip_mined_loop` (called from `refine_strip_mined_loop_macro_nodes`), I'm not convinced there are no other interactions.

Before https://github.com/openjdk/jdk/pull/24890, `OuterStripMinedLoopNode::adjust_strip_mined_loop` was called just before   `C->remove_macro_node(n) `inside the condition `n->Opcode() == Op_OuterStripMinedLoop` [(line 2523)](https://github.com/openjdk/jdk/pull/25682/commits/f42ec1a27ad1767580ef4d480ded846a5ea9fc6a#diff-2faebd05d08f9115f8d9ef771644cf05087a6986c2f9013d7163c6aa720169c3R2523). This lead to assert failure as ` OuterStripMinedLoopNode::adjust_strip_mined_loop` added a new node to the macro list. The conclusion from https://github.com/openjdk/jdk/pull/24890 was that ` OuterStripMinedLoopNode::adjust_strip_mined_loop` should be called before we start the macro elimination and remove macro nodes with Opcode `Op_OuterStripMinedLoop`. This is my reasoning for its current placement to be okay.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25682#discussion_r2166166002


More information about the hotspot-compiler-dev mailing list