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]

[PATCH]: Fix PR tree-optimization/31911


We weren't always caching results of phi_translation for PRE, so
lookups during partial partial insertion could be devastatingly slow.

This fixes it by caching even when the expression doesn't change due
to phi translation.

Bootstrapped and regtested on i686-darwin
Committed to mainline

2007-05-13 Daniel Berlin <dberlin@dberlin.org>

       Fix PR tree-optimization/31911
       * tree-ssa-pre.c (phi_translate): Make sure to cache results even
       if they didn't change the expression.
Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c	(revision 124574)
+++ tree-ssa-pre.c	(working copy)
@@ -1075,8 +1075,8 @@ phi_translate (tree expr, bitmap_set_t s
 		newexpr->base.ann = NULL;
 		vn_lookup_or_add_with_vuses (newexpr, tvuses);
 		expr = newexpr;
-		phi_trans_add (oldexpr, newexpr, pred, tvuses);
 	      }
+	    phi_trans_add (oldexpr, expr, pred, tvuses);
 	  }
       }
       return expr;
@@ -1188,8 +1188,8 @@ phi_translate (tree expr, bitmap_set_t s
 		vn_lookup_or_add_with_vuses (newexpr, newvuses);
 	      }
 	    expr = newexpr;
-	    phi_trans_add (oldexpr, newexpr, pred, newvuses);
 	  }
+	phi_trans_add (oldexpr, expr, pred, newvuses);
       }
       return expr;
       break;
@@ -1233,8 +1233,8 @@ phi_translate (tree expr, bitmap_set_t s
 		vn_lookup_or_add (newexpr, NULL);
 	      }
 	    expr = newexpr;
-	    phi_trans_add (oldexpr, newexpr, pred, NULL);
 	  }
+	phi_trans_add (oldexpr, expr, pred, NULL);
       }
       return expr;
 
@@ -1266,8 +1266,8 @@ phi_translate (tree expr, bitmap_set_t s
 		vn_lookup_or_add (newexpr, NULL);
 	      }
 	    expr = newexpr;
-	    phi_trans_add (oldexpr, newexpr, pred, NULL);
 	  }
+	phi_trans_add (oldexpr, expr, pred, NULL);
       }
       return expr;
 

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