public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* ptx preliminary address space fixes [4/4]
@ 2014-09-11 10:13 Bernd Schmidt
  2014-09-11 11:41 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Schmidt @ 2014-09-11 10:13 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

This one isn't a wrong-code issue, just a missed optimization.  The 
strlen optimizations need to be made to look through 
ADDR_SPACE_CONVERT_EXPR to work on ptx.

Bootstrapped and tested together with the other patches on x86_64-linux. 
  Ok?


Bernd

[-- Attachment #2: ptx-as4.diff --]
[-- Type: text/x-patch, Size: 744 bytes --]

commit 35d765aeba4ea7d0ba829b2b502c8c7af0c24728
Author: Bernd Schmidt <bernds@codesourcery.com>
Date:   Wed Sep 10 16:34:04 2014 +0200

    	* tree-ssa-strlen.c (strlen_optimize_stmt): Look through
    	ADDR_SPACE_CONVERT_EXPR.

diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index bb42cc7..f72ecf5 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -1930,6 +1930,7 @@ strlen_optimize_stmt (gimple_stmt_iterator *gsi)
       if (TREE_CODE (lhs) == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (lhs)))
 	{
 	  if (gimple_assign_single_p (stmt)
+	      || gimple_assign_rhs_code (stmt) == ADDR_SPACE_CONVERT_EXPR
 	      || (gimple_assign_cast_p (stmt)
 		  && POINTER_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt)))))
 	    {

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

* Re: ptx preliminary address space fixes [4/4]
  2014-09-11 10:13 ptx preliminary address space fixes [4/4] Bernd Schmidt
@ 2014-09-11 11:41 ` Richard Biener
  2014-09-17 20:16   ` Bernd Schmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2014-09-11 11:41 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: GCC Patches

On Thu, Sep 11, 2014 at 12:12 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> This one isn't a wrong-code issue, just a missed optimization.  The strlen
> optimizations need to be made to look through ADDR_SPACE_CONVERT_EXPR to
> work on ptx.
>
> Bootstrapped and tested together with the other patches on x86_64-linux.
> Ok?

Did you try adding ADDR_SPACE_CONVERT_EXPR to the tree codes
handled in gimple_assign_cast_p?

Thanks,
Richard.

>
> Bernd

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

* Re: ptx preliminary address space fixes [4/4]
  2014-09-11 11:41 ` Richard Biener
@ 2014-09-17 20:16   ` Bernd Schmidt
  2014-09-22  8:49     ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Schmidt @ 2014-09-17 20:16 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

On 09/11/2014 01:41 PM, Richard Biener wrote:
> On Thu, Sep 11, 2014 at 12:12 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
>> This one isn't a wrong-code issue, just a missed optimization.  The strlen
>> optimizations need to be made to look through ADDR_SPACE_CONVERT_EXPR to
>> work on ptx.
>>
>> Bootstrapped and tested together with the other patches on x86_64-linux.
>> Ok?
>
> Did you try adding ADDR_SPACE_CONVERT_EXPR to the tree codes
> handled in gimple_assign_cast_p?

I did now (full test on x86_64, and also tested with ptx), and that also 
appears to work.  Ok?


Bernd


[-- Attachment #2: convexpr.diff --]
[-- Type: text/x-patch, Size: 542 bytes --]

diff --git a/gcc/gimple.h b/gcc/gimple.h
index ec41585..8d4032b 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -2384,9 +2384,10 @@ gimple_assign_cast_p (const_gimple s)
   if (is_gimple_assign (s))
     {
       enum tree_code sc = gimple_assign_rhs_code (s);
-      return CONVERT_EXPR_CODE_P (sc)
-	     || sc == VIEW_CONVERT_EXPR
-	     || sc == FIX_TRUNC_EXPR;
+      return (CONVERT_EXPR_CODE_P (sc)
+	      || sc == VIEW_CONVERT_EXPR
+	      || sc == FIX_TRUNC_EXPR
+	      || sc == ADDR_SPACE_CONVERT_EXPR);
     }
 
   return false;

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

* Re: ptx preliminary address space fixes [4/4]
  2014-09-17 20:16   ` Bernd Schmidt
@ 2014-09-22  8:49     ` Richard Biener
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2014-09-22  8:49 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: GCC Patches

On Wed, Sep 17, 2014 at 10:15 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> On 09/11/2014 01:41 PM, Richard Biener wrote:
>>
>> On Thu, Sep 11, 2014 at 12:12 PM, Bernd Schmidt <bernds@codesourcery.com>
>> wrote:
>>>
>>> This one isn't a wrong-code issue, just a missed optimization.  The
>>> strlen
>>> optimizations need to be made to look through ADDR_SPACE_CONVERT_EXPR to
>>> work on ptx.
>>>
>>> Bootstrapped and tested together with the other patches on x86_64-linux.
>>> Ok?
>>
>>
>> Did you try adding ADDR_SPACE_CONVERT_EXPR to the tree codes
>> handled in gimple_assign_cast_p?
>
>
> I did now (full test on x86_64, and also tested with ptx), and that also
> appears to work.  Ok?

Ok.

Thanks,
Richard.

>
> Bernd
>

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

end of thread, other threads:[~2014-09-22  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11 10:13 ptx preliminary address space fixes [4/4] Bernd Schmidt
2014-09-11 11:41 ` Richard Biener
2014-09-17 20:16   ` Bernd Schmidt
2014-09-22  8:49     ` Richard Biener

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).