This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch][graphite] Rewrite of "out of graphite"
- From: Richard Guenther <rguenther at suse dot de>
- To: Sebastian Pop <sebpop at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Diego Novillo <dnovillo at google dot com>, Daniel Berlin <dberlin at dberlin dot org>, "Sjodin, Jan" <Jan dot Sjodin at amd dot com>, "Jagasia, Harsha" <harsha dot jagasia at amd dot com>, Christophe Harle <christophe dot harle at amd dot com>, Tobias Grosser <grosser at fim dot uni-passau dot de>, Albert Cohen <Albert dot Cohen at inria dot fr>, Konrad Trifunovic <konrad dot trifunovic at gmail dot com>
- Date: Thu, 4 Dec 2008 11:29:18 +0100 (CET)
- Subject: Re: [patch][graphite] Rewrite of "out of graphite"
- References: <cb9d34b20812022354w2a41bcfeg796ca952c7006e40@mail.gmail.com> <alpine.LNX.2.00.0812031113460.5167@zhemvz.fhfr.qr> <cb9d34b20812031044v6baedb97oa1da7fe0f976acdb@mail.gmail.com>
On Wed, 3 Dec 2008, Sebastian Pop wrote:
> Hi,
>
> On Wed, Dec 3, 2008 at 4:22 AM, Richard Guenther <rguenther@suse.de> wrote:
> > The middle-end parts could have been splitted ;) The middle-end parts
> > are ok, the graphite parts as well, but you may want to wait for more
> > comments from other graphite reviewers.
> >
>
> Thanks for the review Richi. Other Graphite reviewers, if you have
> time, please send me comments on the patches. I plan to commit
> the previous patch to trunk on Friday or Monday to let you enough
> time to review.
>
> Here is another patch fixing id-1.f90 that is a type conversion
> problem arising when expanding to RTL. I committed this to the
> graphite branch. Okay for trunk after regtest passes on amd64-linux?
The following (and similar cases) are clearly bogus:
else if (r->n == 2)
{
- left = clast_to_gcc_expression (r->elts[0], params,
ivstack);
- right = clast_to_gcc_expression (r->elts[1], params,
ivstack);
- return fold_build2 (MIN_EXPR, type, left, right);
+ tree tl = clast_to_gcc_expression (r->elts[0], params,
ivstack);
+ tree tr = clast_to_gcc_expression (r->elts[1], params,
ivstack);
+ tree type = max_precision_type (tl, tr);
+ return fold_build2 (MIN_EXPR, type, tl, tr);
}
you are inserting promotions (well, you are not - you miss
fold_converts to type for both arguments), but this is not your job
but the frontends.
Try the following patch to see if there are type issues with the
graphite.
Richard.
2008-09-11 Richard Guenther <rguenther@suse.de>
* tree-cfg.c (remove_useless_stmts): Verify stmts afterwards.
(verify_stmts): Dispatch to gimple/type verification code.
Index: trunk/gcc/tree-cfg.c
===================================================================
*** trunk.orig/gcc/tree-cfg.c
--- trunk/gcc/tree-cfg.c
*************** remove_useless_stmts (void)
*** 2024,2029 ****
--- 2024,2034 ----
remove_useless_stmts_1 (&gsi, &data);
}
while (data.repeat);
+
+ #ifdef ENABLE_TYPES_CHECKING
+ verify_types_in_gimple_seq (gimple_body (current_function_decl));
+ #endif
+
return 0;
}
*************** verify_stmts (void)
*** 4153,4158 ****
--- 4210,4221 ----
err |= true;
}
}
+
+ if (verify_gimple_phi (phi))
+ {
+ debug_gimple_stmt (phi);
+ err |= true;
+ }
}
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
*************** verify_stmts (void)
*** 4189,4194 ****
--- 4252,4263 ----
}
err |= verify_stmt (&gsi);
+
+ if (verify_types_in_gimple_stmt (gsi_stmt (gsi)))
+ {
+ debug_gimple_stmt (stmt);
+ err |= true;
+ }
addr = walk_gimple_op (gsi_stmt (gsi), verify_node_sharing, &wi);
if (addr)
{