[PATCH, ARM] PR71607: New approach to arm_disable_literal_pool

Andre Vieira (lists) Andre.SimoesDiasVieira@arm.com
Thu Oct 6 13:57:00 GMT 2016


Hello,

This patch tackles the issue reported in PR71607. This patch takes a
different approach for disabling the creation of literal pools. Instead
of disabling the patterns that would normally transform the rtl into
actual literal pools, it disables the creation of this literal pool rtl
by making the target hook TARGET_CANNOT_FORCE_CONST_MEM return true if
arm_disable_literal_pool is true. I added patterns to split floating
point constants for both SF and DFmode. A pattern to handle the
addressing of label_refs had to be included as well since all
"memory_operand" patterns are disabled when
TARGET_CANNOT_FORCE_CONST_MEM returns true. Also the pattern for
splitting 32-bit immediates had to be changed, it was not accepting
unsigned 32-bit unsigned integers with the MSB set. I believe
const_int_operand expects the mode of the operand to be set to VOIDmode
and not SImode. I have only changed it in the patterns that were
affecting this code, though I suggest looking into changing it in the
rest of the ARM backend.

I added more test cases. No regressions for arm-none-eabi with
Cortex-M0, Cortex-M3 and Cortex-M7.

Is this OK for trunk?

Cheers,
Andre

gcc/ChangeLog:

2016-10-06  Andre Vieira  <andre.simoesdiasvieira@arm.com>

    PR target/71607
    * config/arm/arm.md (use_literal_pool): Remove.
    (64-bit immediate split): No longer take cost into consideration
    if 'arm_disable_literal_pool' is enabled.
    (32-bit const split): Remove SImode from constant, which was
    not allowing large unsigned integers to be split.
    * config/arm/arm.c (thumb2_legitimate_address_p): Remove handling
    of 'arm_disable_literal_pool' here.
    (arm_max_const_double_inline_cost): Likewise.
    (arm_cannot_force_const_mem): Return false for
'arm_disable_literal_pool'.
    (thumb2_legitimate_address_p): Remove check involving
'arm_disable_literal_pool'
    that is no longer relevant.
    (arm_legitimate_constant_p): Ignore the outcome of
'arm_cannot_force_const_mem'
    if 'arm_disable_literal_pool' is enabled.
    * config/arm/vfp.md (no_literal_pool_df_immediate): New.
    (no_literal_pool_sf_immediate): New.
    * config/arm/thumb2.md (*thumb2_movsi_labelref_insn): New.

gcc/testsuite/ChangeLog:

2016-10-06  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Thomas Preud'homme  <thomas.preudhomme@arm.com>

    PR target/71607
    * gcc.target/arm/thumb2-slow-flash-data.c: Rename to ...
    * gcc.target/arm/thumb2-slow-flash-data-1.c: ... this.
    * gcc.target/arm/thumb2-slow-flash-data-2.c: New.
    * gcc.target/arm/thumb2-slow-flash-data-3.c: New.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr71607.patch
Type: text/x-patch
Size: 12644 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161006/d49a2b6d/attachment.bin>


More information about the Gcc-patches mailing list