diff mbox

[graphite] Constrain only on INTEGER_TYPE

Message ID 1439411605-10344-1-git-send-email-hiraditya@msn.com
State New
Headers show

Commit Message

Aditya K Aug. 12, 2015, 8:33 p.m. UTC
Passes bootstrap, no regressions.

With this patch gcc bootstraps with graphite.
make BOOT_CFLAGS="-g -O2 -fgraphite-identity -floop-interchange -floop-block"

gcc/ChangeLog:

2015-08-12  Aditya Kumar  <hiraditya@msn.com>

        * graphite-scop-detection.c (stmt_simple_for_scop_p):
	Constrain only on INTEGER_TYPE

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

Comments

Tobias Grosser Aug. 12, 2015, 8:41 p.m. UTC | #1
On 08/12/2015 10:33 PM, Aditya Kumar wrote:
> Passes bootstrap, no regressions.
>
> With this patch gcc bootstraps with graphite.
> make BOOT_CFLAGS="-g -O2 -fgraphite-identity -floop-interchange -floop-block"

LGTM, but please use a longer sentence to explain what you do.

Tobias
Richard Biener Aug. 13, 2015, 10:02 a.m. UTC | #2
On Wed, Aug 12, 2015 at 10:41 PM, Tobias Grosser <tobias@grosser.es> wrote:
> On 08/12/2015 10:33 PM, Aditya Kumar wrote:
>>
>> Passes bootstrap, no regressions.
>>
>> With this patch gcc bootstraps with graphite.
>> make BOOT_CFLAGS="-g -O2 -fgraphite-identity -floop-interchange
>> -floop-block"
>
>
> LGTM, but please use a longer sentence to explain what you do.

As the middle-end generally freely exchanges INTEGER_TYPE
ENUMERAL_TYPE and BOOLEAN_TYPE
you want to use INTEGRAL_TYPE_P here.

RIchard.

> Tobias
Aditya K Aug. 13, 2015, 6:01 p.m. UTC | #3
----------------------------------------
> Date: Thu, 13 Aug 2015 12:02:43 +0200
> Subject: Re: [PATCH] [graphite] Constrain only on INTEGER_TYPE
> From: richard.guenther@gmail.com
> To: tobias@grosser.es
> CC: hiraditya@msn.com; gcc-patches@gcc.gnu.org; s.pop@samsung.com; sebpop@gmail.com
>
> On Wed, Aug 12, 2015 at 10:41 PM, Tobias Grosser <tobias@grosser.es> wrote:
>> On 08/12/2015 10:33 PM, Aditya Kumar wrote:
>>>
>>> Passes bootstrap, no regressions.
>>>
>>> With this patch gcc bootstraps with graphite.
>>> make BOOT_CFLAGS="-g -O2 -fgraphite-identity -floop-interchange
>>> -floop-block"
>>
>>
>> LGTM, but please use a longer sentence to explain what you do.
>
> As the middle-end generally freely exchanges INTEGER_TYPE
> ENUMERAL_TYPE and BOOLEAN_TYPE
> you want to use INTEGRAL_TYPE_P here.
>

Thanks.
I tried INTEGRAL_TYPE_P, and that fails bootstrap. After a little bit of debugging I figured out that adding
ENUMERAL_TYPE causes the failure (miscompile) in tree-vect-data-refs.c. I can 
add INTEGER_TYPE and BOOLEAN_TYPE (bootstrap passes with these). But 
that would be inconsistent with the type-checks at other places in 
graphite-*.c.
Currently, we are only checking for INTEGER_TYPE at other places.

-Aditya


> RIchard.
>
>> Tobias
Richard Biener Aug. 14, 2015, 7:31 a.m. UTC | #4
On Thu, Aug 13, 2015 at 7:56 PM, Aditya K <hiraditya@msn.com> wrote:
>
>
>> Date: Thu, 13 Aug 2015 12:02:43 +0200
>> Subject: Re: [PATCH] [graphite] Constrain only on INTEGER_TYPE
>> From: richard.guenther@gmail.com
>> To: tobias@grosser.es
>> CC: hiraditya@msn.com; gcc-patches@gcc.gnu.org; s.pop@samsung.com;
>> sebpop@gmail.com
>>
>> On Wed, Aug 12, 2015 at 10:41 PM, Tobias Grosser <tobias@grosser.es>
>> wrote:
>> > On 08/12/2015 10:33 PM, Aditya Kumar wrote:
>> >>
>> >> Passes bootstrap, no regressions.
>> >>
>> >> With this patch gcc bootstraps with graphite.
>> >> make BOOT_CFLAGS="-g -O2 -fgraphite-identity -floop-interchange
>> >> -floop-block"
>> >
>> >
>> > LGTM, but please use a longer sentence to explain what you do.
>>
>> As the middle-end generally freely exchanges INTEGER_TYPE
>> ENUMERAL_TYPE and BOOLEAN_TYPE
>> you want to use INTEGRAL_TYPE_P here.
>>
>
> Thanks.
> I tried INTEGRAL_TYPE_P, and that fails bootstrap. After a little bit of
> debugging I figured out that it is
> ENUMERAL_TYPE that causes the failure (miscompile) in tree-vect-data-refs.c.
> I can add INTEGER_TYPE and BOOLEAN_TYPE (bootstrap passes with these). But
> that would be inconsistent with the type-checks at other places in
> graphite-*.c.
> Currently, we are only checking for INTEGER_TYPE at other places.

This is weird - the code you replace did allow both ENUMERAL_TYPE and
BOOLEAN_TYPE.

my suggestion was

                 /* We can not handle REAL_TYPE. Failed for pr39260.  */
-               || TREE_CODE (TREE_TYPE (op)) == REAL_TYPE)
+               || ! INTEGRAL_TYPE_P (TREE_TYPE (op))

you also need to adjust the comment btw.

Richard.

> -Aditya
>
>
>> RIchard.
>>
>> > Tobias
diff mbox

Patch

diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index fb7247e..05cb5b9 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -410,7 +410,7 @@  stmt_simple_for_scop_p (basic_block scop_entry, loop_p outermost_loop,
 	    tree op = gimple_op (stmt, i);
 	    if (!graphite_can_represent_expr (scop_entry, loop, op)
 		/* We can not handle REAL_TYPE. Failed for pr39260.  */
-		|| TREE_CODE (TREE_TYPE (op)) == REAL_TYPE)
+		|| (TREE_CODE (TREE_TYPE (op)) != INTEGER_TYPE))
 	      {
 		if (dump_file && (dump_flags & TDF_DETAILS))
 		  {