diff options
author | Evgeny Stupachenko <evstupac@gmail.com> | 2014-10-13 17:28:24 +0000 |
---|---|---|
committer | Kirill Yukhin <kyukhin@gcc.gnu.org> | 2014-10-13 17:28:24 +0000 |
commit | fa53ca71968d55090aad54653415cd38029b4421 (patch) | |
tree | b3f4799d15bc80d8b0006bd099241bf97e15e97d /gcc | |
parent | bcb21886b9ea0c3836e401b75e0b8304b38aed2f (diff) | |
download | gcc-fa53ca71968d55090aad54653415cd38029b4421.zip gcc-fa53ca71968d55090aad54653415cd38029b4421.tar.gz gcc-fa53ca71968d55090aad54653415cd38029b4421.tar.bz2 |
i386.c (ix86_address_cost): Lower cost for when address contains GOT register.
gcc/
* config/i386/i386.c (ix86_address_cost): Lower cost for
when address contains GOT register.
From-SVN: r216155
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 66fecb9..7dfd1b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-10-13 Evgeny Stupachenko <evstupac@gmail.com> + + * config/i386/i386.c (ix86_address_cost): Lower cost for + when address contains GOT register. + 2014-10-13 Ilya Enkovich <ilya.enkovich@intel.com> Vladimir Makarov <vmakarov@redhat.com> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 2a64d2d..1c38353 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -12455,9 +12455,18 @@ ix86_address_cost (rtx x, enum machine_mode, addr_space_t, bool) || REGNO (parts.index) >= FIRST_PSEUDO_REGISTER))) cost++; + /* When address base or index is "pic_offset_table_rtx" we don't increase + address cost. When a memopt with "pic_offset_table_rtx" is not invariant + itself it most likely means that base or index is not invariant. + Therefore only "pic_offset_table_rtx" could be hoisted out, which is not + profitable for x86. */ if (parts.base + && (!pic_offset_table_rtx + || REGNO (pic_offset_table_rtx) != REGNO(parts.base)) && (!REG_P (parts.base) || REGNO (parts.base) >= FIRST_PSEUDO_REGISTER) && parts.index + && (!pic_offset_table_rtx + || REGNO (pic_offset_table_rtx) != REGNO(parts.index)) && (!REG_P (parts.index) || REGNO (parts.index) >= FIRST_PSEUDO_REGISTER) && parts.base != parts.index) cost++; |