This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Hookize SMALL_REGISTER_CLASSES


On Mon, May 3, 2010 at 12:07 AM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> Take 4. The spam filter is apparently convinced that this patch is
> spam. Trying as .gz now...
>
> On Sun, May 2, 2010 at 10:42 PM, Steven Bosscher <stevenb dot gcc at
> gmail dot com> wrote:
>> Hi,
>>
>> This is a re-post of
>> http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00590.html for GCC 4.6.
>>
>> The actual purpose of this patch is to make it possible to have
>> SMALL_REGISTER_CLASSES be false for some register classes but not for
>> all.
>>
>> In the current situation, SMALL_REGISTER_CLASSES is true or false, but
>> targets are not black and white. ?For x86-64, I've noticed we often
>> get better results with floating point code if I disable
>> SMALL_REGISTER_CLASSES, but it also results in lots of trouble with
>> INTEGRAL_MODE_P modes (similar to what happens if you enable
>> scheduling for x86-64).
>>
>> With the patch, a target can choose to allow more optimizations when
>> it has good reason to believe that registers in some machine modes
>> will not be allocated to small register classes.
>>
>> Bootstrapped&tested on x86_64-unknown-linux-gnu.
>> OK for trunk?

I know it's silly, but can you split out the hookization from the i386
change?  That way the hookization itself becomes obvious and
a i386 maintainer can approve that piece separately (and we can
revert it separately).

And yes, this is an approval for the hookization-only variant.

Thanks,
Richard.

>> Ciao!
>> Steven
>>
>> ? ? ? ?* doc/tm.texi (defmac SMALL_REGISTER_CLASSES): Remove.
>> ? ? ? ?(TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): Add documentation,
>> ? ? ? ?based on the above, for new target hook.
>>
>> ? ? ? ?* hooks.c (hook_bool_mode_true): New generic hook.
>> ? ? ? ?* hooks.h (hook_bool_mode_true): Add prototype.
>>
>> ? ? ? ?* target.h (struct gcc_target): Add small_register_classes_for_mode_p
>> ? ? ? ?target hook.
>> ? ? ? ?* target-def.h (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): New default
>> ? ? ? ?target hook, set to hook_bool_mode_false.
>> ? ? ? ?* regs.h: Remove default definition of SMALL_REGISTER_CLASSES.
>> ? ? ? ?* reload.c (push_secondary_reload): Replace SMALL_REGISTER_CLASSES
>> ? ? ? ?with targetm.small_register_classes_for_mode_p.
>> ? ? ? ?(find_reusable_reload): Likewise.
>> ? ? ? ?(combine_reloads): Likewise.
>> ? ? ? ?* reload1.c (reload_as_needed): Likewise.
>> ? ? ? ?* cse.c (approx_reg_cost_1, hash_rtx_cb): Likewise.
>> ? ? ? ?* ifcvt.c (noce_process_if_block, check_cond_move_block,
>> ? ? ? ?dead_or_predicable): Likewise.
>> ? ? ? ?* regmove.c (optimize_reg_copy_1): Likewise.
>> ? ? ? ?* calls.c (prepare_call_address): Likewise.
>> ? ? ? ?(precompute_register_parameters): Likewise.
>>
>> ? ? ? ?* config/i386/i386.h: Replace SMALL_REGISTER_CLASSES with new target
>> ? ? ? ?hook definition.
>> ? ? ? ?* config/i386/i386.c (ix86_small_register_classes_for_mode_p): Add
>> ? ? ? ?implementation of the hook that considers SSE and 64-bit integer
>> ? ? ? ?register classes "not small".
>> ? ? ? ?* config/i386/i386-protos.h (ix86_small_register_classes_for_mode_p):
>> ? ? ? ?Add prototype.
>>
>> ? ? ? ?* config/sh/sh.h: Replace SMALL_REGISTER_CLASSES with new target
>> ? ? ? ?hook definition.
>> ? ? ? ?* config/sh/sh.c (sh_small_register_classes_for_mode_p): Add
>> ? ? ? ?implementation of the hook that considers all register classes
>> ? ? ? ?small except for SH64.
>> ? ? ? ?(sh_override_options): Use the new hook.
>> ? ? ? ?* config/sh/sh-protos.h (sh_small_register_classes_for_mode_p):
>> ? ? ? ?Add prototype.
>>
>> ? ? ? ?* config/arm/arm.h: Replace SMALL_REGISTER_CLASSES with new target
>> ? ? ? ?hook definition.
>> ? ? ? ?* config/arm/arm.c (arm_small_register_classes_for_mode_p): Add
>> ? ? ? ?implementation of the hook that considers all register classes
>> ? ? ? ?small for THUMB1.
>> ? ? ? ?* config/arm/arm-protos.h (arm_small_register_classes_for_mode_p):
>> ? ? ? ?Add prototype.
>>
>> ? ? ? ?* config/mips/mips.h: Replace SMALL_REGISTER_CLASSES with new target
>> ? ? ? ?hook definition.
>> ? ? ? ?* config/mips/mips.c (mips_small_register_classes_for_mode_p): Add
>> ? ? ? ?implementation of the hook that considers all register classes
>> ? ? ? ?small for MIPS16.
>> ? ? ? ?* config/mips/mips-protos.h (mips_small_register_classes_for_mode_p):
>> ? ? ? ?Add prototype.
>>
>> ? ? ? ?* config/m32c/m32c.h: Replace SMALL_REGISTER_CLASSES with new target
>> ? ? ? ?hook definition.
>> ? ? ? ?* config/pdp11/pdp11.h: Likewise.
>> ? ? ? ?* config/avr/avr.h: Likewise.
>> ? ? ? ?* config/xtensa/xtensa.h: Likewise.
>> ? ? ? ?* config/m68hc11/m68hc11.h: Likewise.
>> ? ? ? ?* config/mn10300/mn10300.h: Likewise.
>> ? ? ? ?* config/mcore/mcore.h: Likewise.
>> ? ? ? ?* config/h8300/h8300.h: Likewise.
>> ? ? ? ?* config/bfin/bfin.h: Likewise.
>>
>> ? ? ? ?* config/iq2000/iq2000.h: Remove SMALL_REGISTER_CLASSES definition.
>> ? ? ? ?* config/rx/rx.h: Remove SMALL_REGISTER_CLASSES definition.
>>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]