[PATCH] Fix IVOPTs induction variable choice for &a[0] and &a[4]

Richard Guenther richard.guenther@gmail.com
Fri Aug 1 15:29:00 GMT 2008


On Fri, Aug 1, 2008 at 5:19 PM, Andrew Thomas Pinski <pinskia@gmail.com> wrote:
> On Aug 1, 2008, at 7:56, Richard Guenther <rguenther@suse.de> wrote:
>
>>
>> This fixes IVOPTs which was choosing two induction variables for uses
>> based on &a[0] and &a[4].  For the use based on &a[4] we add the bases
>> &a[4], 0 and (T *)&a as candidates while for &a[0] we only add the
>> bases &a[0] and 0.  So we end up choosing two different induction
>> variables.  (This happens in SPEC2k6 calculix in the hottest loop)
>>
>> The following fixes this by adding a candidate also if the base
>> object differs after stripping constant offsets.
>>
>> Bootstrap & regtest running on x86_64-unknown-linux-gnu, I'll apply
>> this to the trunk if that succeeds.
>
> Can you benchmark this on another target besides x86?  Iv-opts is very
> target dependent.

Feel free to do so.  I don't think performance testing is necessary at all,
as this just avoids generating two exactly the same induction variables.

Richard.



More information about the Gcc-patches mailing list