On Thu, Nov 13, 2014 at 7:19 AM, Kyrill Tkachov <kyrylo.tkac...@arm.com> wrote:
>
> On 13/11/14 07:24, Andrew Pinski wrote:
>>
>> On Tue, Nov 11, 2014 at 3:55 AM, Kyrill Tkachov <kyrylo.tkac...@arm.com>
>> wrote:
>>>
>>> Hi all,
>>>
>>> This is the aarch64 implementation of the macro fusion hook, used to fuse
>>> mov+movk instructions together.
>>>
>>> A new field is declared in the tuning struct and as we add more fuseable
>>> ops
>>> in the future we will fill in more bits in the fuseable_ops field.
>>>
>>> Bootstrapped and tested on aarch64-none-linux-gnu.
>>>
>>> Ok for trunk?
>>
>> I have a few comments about this patch as I have a patch which depends
>> on this for ThunderX.
>>
>> Each new function should have a comment before it saying what the function
>> does.
>> The checks inside aarch_macro_fusion_pair_p for single_set and
>> any_condjump_p seems a little too restrictive to add more fusion
>> without major changes to the code.
>> In the fusion case I am adding is about fusing any single cycle
>> arithmetic instruction (on ThunderX) that produces flags and the
>> branch that consumes it.
>
>
> Hi Andrew,
>
> Thanks for the feedback, here's an updated patch that should be a bit more
> robust.
>
> How does this look?

It looks good except I notice you have one bug.  curr_set can be null
when you look at its SET_DEST.
I would check simple_sets_p as part of the if that is checking for
AARCH64_FUSE_MOV_MOVK.

Thanks,
Andrew Pinski


>
> Kyrill
>
> 2014-11-13  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>
>
>     * config/aarch64/aarch64.c: Include tm-constrs.h
>     (AARCH64_FUSE_ADRP_ADD): Define.
>     (cortexa57_tunings): Add AARCH64_FUSE_ADRP_ADD to fuseable_ops.
>     (cortexa53_tunings): Likewise.
>     (aarch_macro_fusion_pair_p): Handle AARCH64_FUSE_ADRP_ADD.
>
>
>> Thanks,
>> Andrew
>>
>>> 2014-11-11  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>
>>>
>>>      * config/aarch64/aarch64-protos.h (struct tune_params): Add
>>>      fuseable_ops field.
>>>      * config/aarch64/aarch64.c (generic_tunings): Specify fuseable_ops.
>>>      (cortexa53_tunings): Likewise.
>>>      (cortexa57_tunings): Likewise.
>>>      (thunderx_tunings): Likewise.
>>>      (aarch64_macro_fusion_p): New function.
>>>      (aarch_macro_fusion_pair_p): Likewise.
>>>      (TARGET_SCHED_MACRO_FUSION_P): Define.
>>>      (TARGET_SCHED_MACRO_FUSION_PAIR_P): Likewise.
>>>      (AARCH64_FUSE_MOV_MOVK): Likewise.
>>>      (AARCH64_FUSE_NOTHING): Likewise.

Reply via email to