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] Reorder fields in struct cgraph_edge et al


On Tue, 1 Dec 2009, Martin Jambor wrote:

> Hi,
> 
> On Tue, Dec 01, 2009 at 10:46:33AM +0100, Richard Guenther wrote:
> > On Mon, 30 Nov 2009, Martin Jambor wrote:
> > 
> 
> ...
> 
> > > 2009-11-30  Martin Jambor  <mjambor@suse.cz>
> > > 
> > >         * cgraph.h (GTY): Reorder fields.  Make loop_nest unsigned short int.
> > > 	* ipa-prop.h (struct ipa_param_call_note): Likewise.
> > > 	* ipa-prop.c (ipa_note_param_call): Set note->loop_nest.
> > > 
> > > Index: icln/gcc/cgraph.h
> > > ===================================================================
> > > --- icln.orig/gcc/cgraph.h
> > > +++ icln/gcc/cgraph.h
> > > @@ -310,6 +310,8 @@ typedef enum {
> > >  } cgraph_inline_failed_t;
> > >  
> > >  struct GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) cgraph_edge {
> > > +  /* Expected number of executions: calculated in profile.c.  */
> > > +  gcov_type count;
> > 
> > you now have introduced 32bit padding here ...
> > 
> 
> No, even on i386 gcov_type is 64 bit.  I have just double checked.
> I have committed the patch as it was per Honza's approval.

But what's the point moving it first, even before the next pointer?
The next pointer is accessed during traversing, possibly quite more
frequent than count.

Richard.

> 
> Martin
> 
> 
> > Ok with that chagnes.
> > 
> > Richard.
> > 
> > >    /* Linked list's next */
> > >    struct ipa_param_call_note *next;
> > >    /* Statement that contains the call to the parameter above.  */
> > > @@ -147,13 +149,11 @@ struct ipa_param_call_note
> > >    unsigned int lto_stmt_uid;
> > >    /* Index of the parameter that is called.  */
> > >    int formal_id;
> > > -  /* Expected number of executions: calculated in profile.c.  */
> > > -  gcov_type count;
> > >    /* Expected frequency of executions within the function. see cgraph_edge in
> > >       cgraph.h for more on this. */
> > >    int frequency;
> > >    /* Depth of loop nest, 1 means no loop nest.  */
> > > -  int loop_nest;
> > > +  unsigned short int loop_nest;
> > >    /* Set when we have already found the target to be a compile time constant
> > >       and turned this into an edge or when the note was found unusable for some
> > >       reason.  */
> > > 
> > > 
> 
> 

-- 
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


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