On Mon, 26 Mar 2012, Razya Ladelsky wrote:

> Hi,
> 
> This is (hopefully) a permanent fix  to pr46886.c
> I removed the condition preventing parallelization of do_while loops, as 
> it 
> was blocking parallelizing important loops in spec-2006.
> The patch fixes the number of iterations for cases where the body could 
> appear in the latch, as in pr46886.c.
> 
> 2012-03-26  Razya Ladelsky  <ra...@il.ibm.com>
> 
>                  PR tree-optimization/46886
>                  * tree-parloops.c (transform_to_exit_first_loop):Set 
> number of iterations correctly when the body may appear at the latch.
>                  (pallelize_loops): Remove the condition preventing 
> do-while loops.
>  
> 
> 
> Bootstrap and testsuite psss successfully on power7 linux machine.
> Ok to commit?

+  
+  /* if the latch contains more than the one statemnt of control variable 
+     increment then it contains the body.  */
+  if (exit_1->dest == loop->latch && last_and_only_stmt (loop->latch))
     new_rhs = gimple_cond_rhs (cond_stmt);

please check what the comment suggests, thus,

       && last_and_only_stmt (loop->latch) == cond_stmt

tree-parloops.c is quite fragile in what it expects the IL to look like
and tests do not cover what later code expects.  Please do not add to 
that.

@@ -2146,7 +2149,6 @@ parallelize_loops (void)
     return false;
   if (cfun->has_nonlocal_label)
     return false;
-

spurious whitespace change.

@@ -2213,6 +2212,7 @@ parallelize_loops (void)
        continue;
 
       changed = true;
+       
       if (dump_file && (dump_flags & TDF_DETAILS))
       {
        if (loop->inner)

Likewise.

Ok with the above change.

Thanks,
Richard.

Reply via email to