This is the mail archive of the 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: My opinions on tree-level and RTL-level optimization (Richard Kenner) writes:

  >     The correct viewpoint is "we shouldn't remove CSE until every
  >     *profitable* transformation it makes is subsumed by something else".
  > And, as I understand it, the claim is that this is not yet true for the
  > following of jumps and my question is why.

One reason could be that there are some aspects of alias analysis that
are implemented at RTL level, but are not implemented at tree level. 
 - accesses to different fields of the same struct
 - accesses to different elements of the same array
 - restricted pointers 

(Dan Berlin is working on the first one (first two?))

An example: 
struct s {  int a;  int b;};
void foo (struct s *ps,  int *p, int *__restrict__ rp, int *__restrict__ rq)
  ps->a = 0;
  ps->b = 1;
  if (ps->a != 0)    abort ();
  p[0] = 0;
  p[1] = 1;
  if (p[0] != 0)     abort ();
  rp[0] = 0;
  rq[0] = 1;
  if (rp[0] != 0)     abort();

The tree optimizers don't do anything interesting with this function,
cse eliminates all the ifs. 


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