public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, x86][PIC] Making check for PIC register in address cost calculation only on RTL level
@ 2014-12-12 12:21 Zamyatin, Igor
  2014-12-15 10:49 ` Uros Bizjak
  0 siblings, 1 reply; 2+ messages in thread
From: Zamyatin, Igor @ 2014-12-12 12:21 UTC (permalink / raw)
  To: GCC Patches (gcc-patches@gcc.gnu.org); +Cc: ubizjak

Hi!

When adding checks for PIC register in address cost calculation (http://gcc.gnu.org/ml/gcc-cvs/2014-10/msg00411.html) it was meant to affect only RTL passes.
Since !pic_offset_table_rtx is not enough for it (I see that pic_offset_table_rtx enabled on GIMPLE level) following change explicitly adds this restriction.

Bootstrapped and regtested with RUNTESTFLAGS="--target_board='unix{-m32,-fpic}'"
Is it ok for trunk?

Thanks,
Igor

Changelog:


2014-12-12  Igor Zamyatin  <igor.zamyatin@intel.com>

	* config/i386/i386.c (ix86_address_cost): Add explicit restriction
	to RTL level for the check for PIC register.


diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index fffddfc..799411c 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -12802,12 +12802,14 @@ ix86_address_cost (rtx x, machine_mode, addr_space_t, bool)
      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))
+      && (current_pass->type == GIMPLE_PASS
+	  || (!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))
+      && (current_pass->type == GIMPLE_PASS
+	  || (!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++;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, x86][PIC] Making check for PIC register in address cost calculation only on RTL level
  2014-12-12 12:21 [PATCH, x86][PIC] Making check for PIC register in address cost calculation only on RTL level Zamyatin, Igor
@ 2014-12-15 10:49 ` Uros Bizjak
  0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2014-12-15 10:49 UTC (permalink / raw)
  To: Zamyatin, Igor; +Cc: GCC Patches (gcc-patches@gcc.gnu.org)

On Fri, Dec 12, 2014 at 1:21 PM, Zamyatin, Igor <igor.zamyatin@intel.com> wrote:

> When adding checks for PIC register in address cost calculation (http://gcc.gnu.org/ml/gcc-cvs/2014-10/msg00411.html) it was meant to affect only RTL passes.
> Since !pic_offset_table_rtx is not enough for it (I see that pic_offset_table_rtx enabled on GIMPLE level) following change explicitly adds this restriction.
>
> Bootstrapped and regtested with RUNTESTFLAGS="--target_board='unix{-m32,-fpic}'"
> Is it ok for trunk?
>
> 2014-12-12  Igor Zamyatin  <igor.zamyatin@intel.com>
>
>         * config/i386/i386.c (ix86_address_cost): Add explicit restriction
>         to RTL level for the check for PIC register.

OK.

Thanks,
Uros.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-15 10:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-12 12:21 [PATCH, x86][PIC] Making check for PIC register in address cost calculation only on RTL level Zamyatin, Igor
2014-12-15 10:49 ` Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).