This is the mail archive of the
mailing list for the GCC project.
Re: IVs optimization issue
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Aurelien Buhrig <aurelien dot buhrig dot gcc at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 29 Feb 2012 16:15:29 +0100
- Subject: Re: IVs optimization issue
- Authentication-results: mr.google.com; spf=pass (google.com: domain of firstname.lastname@example.org designates 10.50.12.231 as permitted sender) email@example.com; dkim=pass firstname.lastname@example.org
- References: <4F4DDDBB.email@example.com> <CAFiYyc3p5=vaKvJfeq2j1f9SNJGJkLhd92ShUwuadFT1YGUmmw@mail.gmail.com> <4F4E3F7B.firstname.lastname@example.org>
On Wed, Feb 29, 2012 at 4:08 PM, Aurelien Buhrig
>> The issue is most probably that on GIMPLE we only deal with ptr_mode,
>> not Pmode, and IVOPTs thinks that pointer induction variables will
>> have ptr_mode. ?To fix this the cost computation would need to take
>> into account ptr_mode to Pmode conversions _and_ would need to
>> consider Pmode IVs in the first place (I'm not sure that will be easy).
> Thank you Richard for you reply.
> I guess such an issue is not in the top priority tasks of main
> developers. So I think I'll have to look at it myself if I feel
> confident enough to carry out such a job (I've never worked at tree level).
> My main wonder is about Pmode IVs: since GIMPLE representation only
> deals with ptr_mode, what differentiates a Pmode IV from a ptr_mode one?
Its TREE_TYPE. In your case you'd have a POINTER_TYPE with
PSImode for Pmode and a POINTER_TYPE with SImode for ptr_mode
pointers. They will differ in TYPE_MODE and TYPE_PRECISION.
> BTW, this wonder is not limited to IVs. What does control the choice of
> Pmode vs ptr_mode when mapping to RTL?
ptr_mode is the C language specified mode for all pointers. Pmode is
the mode used for pointers in address operands of CPU instructions.
Usually they are the same. When mapping to RTL all ptr_mode uses
for memory accesses are translated to Pmode while operations on
the value of ptr_mode quantities are done on ptr_mode (IIRC).