This is the mail archive of the
mailing list for the GCC project.
Re: Code optimization only in loops
- From: Jean Christophe Beyler <jean dot christophe dot beyler at gmail dot com>
- To: Paolo Bonzini <paolo dot bonzini at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 13 Jul 2009 17:30:31 -0400
- Subject: Re: Code optimization only in loops
- References: <email@example.com> <4A03F8EA.firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <4A320A07.email@example.com>
Sorry to be coming back to this problem, I'm working on many projects
at the same time at the moment.
The port actually has a shift-immediate. It actually sees it later in
the fwprop pass:
In insn 14, replacing
(ashift:DI (reg:DI 79)
with (ashift:DI (reg:DI 79)
(const_int 3 [0x3]))
Changed insn 14
deferring rescan insn with uid = 14.
(not the same numbers but you get the idea). I don't understand why
there is a problem here but it does seem that it is linked to the way
my port handles the calculations of addresses.
Thanks again if you have any ideas, or anything I can do to give
information or ideas,
On Fri, Jun 12, 2009 at 3:55 AM, Paolo Bonzini<firstname.lastname@example.org> wrote:
> Jean Christophe Beyler wrote:
>> I've gone back to this problem (since I've solved another one ;-)).
>> And I've moved forward a bit:
>> It seems that if I consider an array of characters, there are no
>> longer any shifts and therefore I do get my two loads with the use of
>> an offset:
> The reason there are shifts instead of multiplies is that multiplications
> are canonicalized to shifts whenever possible outside addresses, because a
> shift instruction should be more efficient.
> The interesting dump should be fwprop which is where the address generation
> From your dumps, however, the problem seems to be that you do not have a
> shift-by-immediate instruction. ?You may consider adding it even though it
> does not apply to your assembly, either with define_insn_and_split or by
> loosening the predicate and keeping a "r" constraint (or whatever you're
> using now).