This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: should MEM tracking be able to optimize this?
- From: Dan Nicolaescu <dann at ics dot uci dot edu>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 17 Nov 2001 11:23:03 -0800
- Subject: Re: should MEM tracking be able to optimize this?
- References: <10111162314.AA25483@vlsi1.ultra.nyu.edu>
Richard Kenner <kenner@vlsi1.ultra.nyu.edu> writes:
Or it's not considered to be worth the effort?
It's a hard problem because there's a limit to what you can keep track of.
It's not clear it's common enough to be worth the effort.
I think this type of code might be used in the image processing
world. They pass around pointers to structures containing arrays.
Code like this also exhibits the problem:
struct mystruct{
float f[2048];
float p[2048];
float q[2048];
float d[2048];
};
void
calc4 (struct mystruct *C)
{
int i;
for (i = 0; i < 1024; ++i) {
C->f[i] = C->p[i] + C->q[i];
C->d[i] = C->p[i] + C->q[i];
C->f[i] = C->f[i] + C->p[i] + C->q[i];
}
}
Would it be possible to put the fields in different alias sets at
tree->rtl conversion time (or whenever the alias sets are first
computed), as we should know they don't overlap?