+2006-06-21 Richrad Guenther <rguenther@suse.de>
+
+ * tree-ssa-loop-niter.c (simplify_using_initial_conditions):
+ Limit iteration over the dominators.
+
2006-06-20 Roger Sayle <roger@eyesopen.com>
* config/mips/iris6.h (LIB_SPEC): Add support for -pthread.
return tree_simplify_using_condition_1 (cond, expr);
}
-
+
+/* The maximum number of dominator BBs we search for conditions
+ of loop header copies we use for simplifying a conditional
+ expression. */
+#define MAX_DOMINATORS_TO_WALK 8
+
/* Tries to simplify EXPR using the conditions on entry to LOOP.
Record the conditions used for simplification to CONDS_USED.
Returns the simplified expression (or EXPR unchanged, if no
edge e;
basic_block bb;
tree exp, cond;
+ int cnt = 0;
if (TREE_CODE (expr) == INTEGER_CST)
return expr;
+ /* Limit walking the dominators to avoid quadraticness in
+ the number of BBs times the number of loops in degenerate
+ cases. */
for (bb = loop->header;
- bb != ENTRY_BLOCK_PTR;
+ bb != ENTRY_BLOCK_PTR && cnt < MAX_DOMINATORS_TO_WALK;
bb = get_immediate_dominator (CDI_DOMINATORS, bb))
{
if (!single_pred_p (bb))
cond);
expr = exp;
+ ++cnt;
}
return expr;