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] for PR 27144


Zdenek Dvorak wrote:
> > 
> > Do you have any figures on what the change to fix PR 23434 has cost us
> > in terms of performance? 
> 
> no.  Sebastian, did you do any measurements before commiting that patch?
> 

no.  I'm counting how many cases we now are missing with because of
that patch...  I just began a bootstrap with an older version of trunk
and the attached patch.  For the moment I'm at more than a thousand
missed cases of the form:

(unsigned intD.3) D.30156_23
jD.31044_544 > 2 ? 0 : 2 - jD.31044_544
numD.29685_5
etc.

Index: tree-ssa-loop-niter.c
===================================================================
--- tree-ssa-loop-niter.c	(revision 113071)
+++ tree-ssa-loop-niter.c	(working copy)
@@ -1760,6 +1760,7 @@ proved_non_wrapping_p (tree at_stmt,
 		       tree new_type,
 		       tree valid_niter)
 {
+  bool noncst = false;
   tree cond;
   tree bound = niter_bound->bound;
   enum tree_code cmp;
@@ -1771,7 +1772,7 @@ proved_non_wrapping_p (tree at_stmt,
 
   /* Give up if BOUND was not folded to an INTEGER_CST, as in PR23434.  */
   if (TREE_CODE (bound) != INTEGER_CST)
-    return false;
+    noncst = true;
 
   /* After the statement niter_bound->at_stmt we know that anything is
      executed at most BOUND times.  */
@@ -1784,7 +1785,14 @@ proved_non_wrapping_p (tree at_stmt,
 
   cond = fold_binary (cmp, boolean_type_node, valid_niter, bound);
   if (nonzero_p (cond))
-    return true;
+    {
+      if (noncst)
+	{
+	  fprintf (stderr, "missedOne\n");
+	  debug_generic_expr (bound);
+	}
+      return true;
+    }
 
   cond = build2 (cmp, boolean_type_node, valid_niter, bound);
   /* Try taking additional conditions into account.  */
@@ -1793,7 +1801,14 @@ proved_non_wrapping_p (tree at_stmt,
 		      cond);
 
   if (nonzero_p (cond))
-    return true;
+    {
+      if (noncst)
+	{
+	  fprintf (stderr, "missedOne\n");
+	  debug_generic_expr (bound);
+	}
+      return true;
+    }
 
   return false;
 }



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