This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/4] Outline fold_or_predicates from add_to_predicate_list.


On Fri, Jul 9, 2010 at 7:03 PM, Sebastian Pop <sebpop@gmail.com> wrote:
> On Fri, Jul 9, 2010 at 11:42, Sebastian Pop <sebpop@gmail.com> wrote:
>> On Fri, Jul 9, 2010 at 07:12, Richard Guenther <rguenther@suse.de> wrote:
>>> On Thu, 8 Jul 2010, Sebastian Pop wrote:
>>>
>>>> ? ? ? * tree-if-conv.c (fold_or_predicates): New.
>>>> ? ? ? (add_to_predicate_list): Call it.
>>>
>
> Please see attached the updated patch.
> The changes with respect to the previous patch are:

Ok.

Thanks,
Richard.

> diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
> index b0ac9b2..0f1caaa 100644
> --- a/gcc/tree-if-conv.c
> +++ b/gcc/tree-if-conv.c
> @@ -300,10 +300,10 @@ parse_predicate (tree cond, tree *op0, tree *op1)
> ? return ERROR_MARK;
> ?}
>
> -/* Returns the fold of predicate C1 OR C2. ?*/
> +/* Returns the fold of predicate C1 OR C2 at location LOC. ?*/
>
> ?static tree
> -fold_or_predicates (tree c1, tree c2)
> +fold_or_predicates (location_t loc, tree c1, tree c2)
> ?{
> ? tree op1a, op1b, op2a, op2b;
> ? enum tree_code code1 = parse_predicate (c1, &op1a, &op1b);
> @@ -317,8 +317,7 @@ fold_or_predicates (tree c1, tree c2)
> ? ? ? ?return t;
> ? ? }
>
> - ?return fold_build2_loc (UNKNOWN_LOCATION, TRUTH_OR_EXPR,
> - ? ? ? ? ? ? ? ? ? ? ? ? boolean_type_node, c1, c2);
> + ?return fold_build2_loc (loc, TRUTH_OR_EXPR, boolean_type_node, c1, c2);
> ?}
>
> ?/* Add condition NC to the predicate list of basic block BB. ?*/
> @@ -334,7 +333,10 @@ add_to_predicate_list (basic_block bb, tree nc)
> ? if (!is_predicated (bb))
> ? ? bc = nc;
> ? else
> - ? ?bc = fold_or_predicates (nc, bb_predicate (bb));
> + ? ?{
> + ? ? ?bc = bb_predicate (bb);
> + ? ? ?bc = fold_or_predicates (EXPR_LOCATION (bc), nc, bc);
> + ? ?}
>
> ? if (!is_gimple_condexpr (bc))
> ? ? {
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]