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: VRP speedup


Jan Hubicka wrote on 12/06/06 08:19:

My overall plan with VRP is after this patch avoid more of the direct
folder calls (first they tend to be wrong comparing boolean_true_node
and they are mostly convertible to the new comparsion thingy.), rewrite
the ranges_intersect_p predicate so it does two comparsions instead of 6

Sounds good.

and then try to reorg the propagation engine to avoid propagating over
unchanged PHI edges.

I don't follow, to do merging on a PHI node, you still need the values
of the executed edges.  You just don't visit the source more than
once.  Scheduling big PHI nodes late, will help but you *do* need to
visit them.

	* tree-vrp.c (operand_less_p): New.
	(compare_values, value_inside_range): Rewrite in terms of
	operand_less_p.

OK after testing.

+ /* Return + 1 if VAL < VAL2
+ 0 if !(VAL < VAL2)
+ -2 if those are incomparable. */
+ static inline int


Vertical spacing after comment.

+ operand_less_p (tree val, tree val2)
+ {
+   tree tcmp;
+   /* LT is folded faster than GE and others.  Inline the common case.  */

Spacing before comment.

+   if (TREE_CODE (val) == INTEGER_CST && TREE_CODE (val2) == INTEGER_CST)
+     {
+       if (TYPE_UNSIGNED (TREE_TYPE (val)))
+ 	return INT_CST_LT_UNSIGNED (val, val2);
+       else
+ 	return INT_CST_LT (val, val2);
+     }
+   else
+     tcmp = fold_binary_to_constant (LT_EXPR, boolean_type_node, val, val2);
+   if (!tcmp)

Spacing before if().

+     return -2;
+   return !integer_zerop (tcmp);

Spacing before return (Yes, I'm claustrophobic).


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