RFR: 8282208: Reduce MachNode size

Tobias Hartmann thartmann at openjdk.java.net
Wed Feb 23 08:10:45 UTC 2022


On Mon, 21 Feb 2022 16:19:01 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:

> Hi,
> 
> This patch reduces the size of MachNode from 72  to 64 bytes in product builds, and from 120 to 104 bytes in debug builds. In debug builds the size of Node is reduced from 104 to 96 bytes.
> 
> The motivation for this patch is that I needed more bits for the _barrier_data field. (This will happen in another patch.) I noticed that the bool _remove field caused a lot of padding. It's only used by peephole and can as well be modeled as a Node::flag. This change together with a slight rearrangement of fields a lot of unnecessary padding can be eliminated. 
> 
> Fixes in this patch:
> 
> 1) Change MachNode::_remove to a Node::flag
> 
> 2) Changing MachNode::operands to a 16 bit unsigned (Allowing room for 16 bits _barrier_data later) 
> 
> 3) Moving Node::_debug_idx below Node::_debug_orig saves 8 bytes in debug builds. This is achieved by having an even number of 4 bytes fields in a row, eliminating two 4 byte paddings.
> 
> Please review,
> Nils Eliasson

The value of `Node::_last_flag` needs to be updated.

src/hotspot/share/opto/node.hpp line 790:

> 788:     Flag_for_post_loop_opts_igvn     = 1 << 16,
> 789:     Flag_is_removed_by_peephole      = 1 << 17,
> 790:     _last_flag                       = Flag_for_post_loop_opts_igvn

Suggestion:

    Flag_is_removed_by_peephole      = 1 << 17,
    _last_flag                       = Flag_is_removed_by_peephole

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

Changes requested by thartmann (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7562


More information about the hotspot-compiler-dev mailing list