public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Graphite cannot handle return stmt
       [not found] <1435611532-31080-1-git-send-email-hiraditya at msn dot com>
@ 2015-06-30 20:55 ` Aditya Kumar
  2015-07-02  7:52   ` Tobias Grosser
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Kumar @ 2015-06-30 20:55 UTC (permalink / raw)
  To: gcc-patches, sebpop, tobias, hiraditya

No regressions.

2015-06-29  Aditya Kumar  <aditya.k7@samsung.com>
            Sebastian Pop <s.pop@samsung.com>

        * graphite-scop-detection.c (stmt_simple_for_scop_p): Bail out in case of a return statement.

---
 gcc/graphite-scop-detection.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index e8ddecd..a14142f 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -364,7 +364,6 @@ stmt_simple_for_scop_p (basic_block scop_entry, loop_p outermost_loop,
 
   switch (gimple_code (stmt))
     {
-    case GIMPLE_RETURN:
     case GIMPLE_LABEL:
       return true;
 
-- 
2.1.0.243.g30d45f7

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

* Re: [PATCH] Graphite cannot handle return stmt
  2015-06-30 20:55 ` [PATCH] Graphite cannot handle return stmt Aditya Kumar
@ 2015-07-02  7:52   ` Tobias Grosser
  0 siblings, 0 replies; 6+ messages in thread
From: Tobias Grosser @ 2015-07-02  7:52 UTC (permalink / raw)
  To: Aditya Kumar, gcc-patches, sebpop

On 06/30/2015 10:50 PM, Aditya Kumar wrote:
> No regressions.
>
> 2015-06-29  Aditya Kumar  <aditya.k7@samsung.com>
>              Sebastian Pop <s.pop@samsung.com>
>
>          * graphite-scop-detection.c (stmt_simple_for_scop_p): Bail out in case of a return statement.

LGTM.

Tobias

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

* Re: [PATCH] Graphite cannot handle return stmt
  2015-06-30  6:43   ` Tobias Grosser
@ 2015-06-30  8:16     ` Richard Biener
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Biener @ 2015-06-30  8:16 UTC (permalink / raw)
  To: Tobias Grosser; +Cc: Sebastian Pop, Aditya Kumar, GCC Patches

On Tue, Jun 30, 2015 at 8:12 AM, Tobias Grosser <tobias@grosser.es> wrote:
> On 06/30/2015 02:12 AM, Sebastian Pop wrote:
>>
>> On Mon, Jun 29, 2015 at 3:58 PM, Aditya Kumar <hiraditya@msn.com> wrote:
>>>
>>> No regressions.
>>>
>>> 2015-06-29  Aditya Kumar  <aditya.k7@samsung.com>
>>>              Sebastian Pop <s.pop@samsung.com>
>>>
>>>          * graphite-scop-detection.c (stmt_simple_for_scop_p): Bail out
>>> in case of a return statement.
>>
>>
>> Looks good to me.
>> Tobi, do you see a good reason not to cut scops at return stmts?
>
>
> Return stmts in a SCoP are definitely invalid. Now, as in my last email, I
> wonder why this is not a positive list. There are probably a lot of gimple
> codes that are invalid inside scops. By default we should refuse everything
> we do _not_ know.

The function already does that.  It just accepted GIMPLE_RETURN as valid.

IMHO a

   default:
     gcc_unreachable ();

is the best style as it forces you to list everything explicitely.
The function should
be refactored to do all codes in the switch stmt (GIMPLE_ASMs are handled
in a if, so are GIMPLE_DEBUG for example).

Richard.

> Best,
> Tobias

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

* Re: [PATCH] Graphite cannot handle return stmt
  2015-06-30  0:43 ` Sebastian Pop
@ 2015-06-30  6:43   ` Tobias Grosser
  2015-06-30  8:16     ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Tobias Grosser @ 2015-06-30  6:43 UTC (permalink / raw)
  To: Sebastian Pop, Aditya Kumar; +Cc: GCC Patches

On 06/30/2015 02:12 AM, Sebastian Pop wrote:
> On Mon, Jun 29, 2015 at 3:58 PM, Aditya Kumar <hiraditya@msn.com> wrote:
>> No regressions.
>>
>> 2015-06-29  Aditya Kumar  <aditya.k7@samsung.com>
>>              Sebastian Pop <s.pop@samsung.com>
>>
>>          * graphite-scop-detection.c (stmt_simple_for_scop_p): Bail out in case of a return statement.
>
> Looks good to me.
> Tobi, do you see a good reason not to cut scops at return stmts?

Return stmts in a SCoP are definitely invalid. Now, as in my last email, 
I wonder why this is not a positive list. There are probably a lot of 
gimple codes that are invalid inside scops. By default we should refuse 
everything we do _not_ know.

Best,
Tobias

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

* Re: [PATCH] Graphite cannot handle return stmt
  2015-06-29 21:33 Aditya Kumar
@ 2015-06-30  0:43 ` Sebastian Pop
  2015-06-30  6:43   ` Tobias Grosser
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Pop @ 2015-06-30  0:43 UTC (permalink / raw)
  To: Aditya Kumar, Tobias Grosser; +Cc: GCC Patches

On Mon, Jun 29, 2015 at 3:58 PM, Aditya Kumar <hiraditya@msn.com> wrote:
> No regressions.
>
> 2015-06-29  Aditya Kumar  <aditya.k7@samsung.com>
>             Sebastian Pop <s.pop@samsung.com>
>
>         * graphite-scop-detection.c (stmt_simple_for_scop_p): Bail out in case of a return statement.

Looks good to me.
Tobi, do you see a good reason not to cut scops at return stmts?

Thanks,
Sebastian

>
> ---
>  gcc/graphite-scop-detection.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
> index e8ddecd..a10702e 100644
> --- a/gcc/graphite-scop-detection.c
> +++ b/gcc/graphite-scop-detection.c
> @@ -365,6 +365,8 @@ stmt_simple_for_scop_p (basic_block scop_entry, loop_p outermost_loop,
>    switch (gimple_code (stmt))
>      {
>      case GIMPLE_RETURN:
> +      return false;
> +
>      case GIMPLE_LABEL:
>        return true;
>
> --
> 2.1.0.243.g30d45f7
>

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

* [PATCH] Graphite cannot handle return stmt
@ 2015-06-29 21:33 Aditya Kumar
  2015-06-30  0:43 ` Sebastian Pop
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Kumar @ 2015-06-29 21:33 UTC (permalink / raw)
  To: gcc-patches, hiraditya, sebpop

No regressions.

2015-06-29  Aditya Kumar  <aditya.k7@samsung.com>
	    Sebastian Pop <s.pop@samsung.com>

        * graphite-scop-detection.c (stmt_simple_for_scop_p): Bail out in case of a return statement.

---
 gcc/graphite-scop-detection.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index e8ddecd..a10702e 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -365,6 +365,8 @@ stmt_simple_for_scop_p (basic_block scop_entry, loop_p outermost_loop,
   switch (gimple_code (stmt))
     {
     case GIMPLE_RETURN:
+      return false;
+
     case GIMPLE_LABEL:
       return true;
 
-- 
2.1.0.243.g30d45f7

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

end of thread, other threads:[~2015-07-02  7:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1435611532-31080-1-git-send-email-hiraditya at msn dot com>
2015-06-30 20:55 ` [PATCH] Graphite cannot handle return stmt Aditya Kumar
2015-07-02  7:52   ` Tobias Grosser
2015-06-29 21:33 Aditya Kumar
2015-06-30  0:43 ` Sebastian Pop
2015-06-30  6:43   ` Tobias Grosser
2015-06-30  8:16     ` 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).