This is the mail archive of the
mailing list for the GCC project.
Code optimization with GCSE
- From: Jean Christophe Beyler <jean dot christophe dot beyler at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 14 Jul 2009 16:01:41 -0400
- Subject: Code optimization with GCSE
As some might know, I've been concentrating on optimizing the handling
of loads for my port of GCC. I'm now considering this code:
uint64_t foo (void)
uint64_t x0, x1, x2, x3, x4, x5,x6,x7;
data[i] = i;
return data + data + data;
However, the code I get is:
mov r8, r9
#LOOP, of no consequence, it uses r8 for the stores...
la r7,data+8 #Loads data+8 in r7 instead of using r9 directly
ldd r9,0(r9) #This loads from r9 and the two next from r7
As you can see, the compiler uses r9 to store data and then uses that
for data but also loads in r7 data+8 instead of directly using r9.
If I remove the loop then it does not do this.
Any ideas where I can look for this, or is this going to be difficult to fix?
Jean Christophe Beyler