This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add comments to struct cgraph_thunk_info


On 09/14/2017 07:16 PM, Jeff Law wrote:
The comment additions are fine.  What's the rationale behind the
ordering of the fields?  In general we want the opposite order from what
you did -- going from most strictly aligned to least strictly aligned
minimizes the amount of unused padding.

Thank you for the review!

I moved them because I thought it would make more sense to readers: flag that describe the “shape” of the thunk, and then the associated data, whose validity depends on the flags. I also thought that in practice, cgraph_thunk_info is embedded only in the cgraph_node class, and the field after “thunk” (“count”, a profile_count class) must be aligned at least on 8 bytes (because of n_bits/m_quality), so this change would not matter structure-size-wise.

I’m not super confident about this though, so I’ll resubmit a patch without the reordering: I’ve added more comments anyway as I’ve learned more about this since yesterday. ;-)

--
Pierre-Marie de Rodat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]