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] Fix IVOPTs problem


On 8/11/05, Daniel Berlin <dberlin@dberlin.org> wrote:
> >
> >  #   VUSE <SFT.1_8>;
> >  D.1295_5 = ep.rx_skbuff[i_10];
> >
> > SFT.1_8 is specific to the rx_skbuff field of this structure.
> >
> > rewrite_use turns it into:
> >
> >  #   VUSE <SFT.1_8>;
> >  #   VUSE <SFT.2>;
> >  D.1295_5 = MEM[base: ep.37_13, index: D.1339_14, step: 4B];
> >
> > Note the addition of SFT.2, which represents the rx_ring field within
> > the structure.
> ..
> > information carried for this statement.  There's no way this statement
> > will touch rx_ring.

Note that we have _some_ information about offsets in TMR (but
not in this case), so improving get_ref_tag wrt SFTs may solve some
of the problems, or some hacking in get_tmr_operands to do offset
matching like we do for COMPONENT_REF using get_inner_reference.

> This unfortunately isn't the only case we lose precision when we perform
> optimization into semantically equivalent code related to structure
> accesses.
> 
> Any time we turn a single pointer deref into a pointer to field access, we
> lose precision right now.
> 
> p_12->a = 5;
> p_12->b = 6;
> 
> vs
> 
> q_13 = &p_12->a;
> *q_13 = 5;
> q_14 = &p_12->b;
> *q_14 = 6;
> 
> (The second will have points-to-sets on the pointers that have exactly one
> SFT each.  THe first will have two SFT's each).

Note that this is precisely why I was pushing for forwprop propagating
of multiple-use ADDR_EXPR to their uses -- it avoids some serious
pessimizations due to these aliasing issues (for tramp3d).

Just I wasn't able to give such a good reason for the speedup I was
seeing ;)

See
http://gcc.gnu.org/ml/gcc-patches/2005-07/msg01702.html

Richard.


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