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: [RFA][PATCH] Improve VRP of COND_EXPR_CONDs


On 04/06/2013 07:08 AM, Steven Bosscher wrote:

+      if (!SSA_NAME_OCCURS_IN_ABNORMAL_PHI (innerop))
+       {
+         value_range_t *vr = get_value_range (innerop);
+

I don't think the SSA_NAME_OCCURS_IN_ABNORMAL_PHI test is necessary,
get_value_range() will simply return a !VR_RANGE.
It's not necessary -- the code was templated from an unsubmitted related change to tree-ssa-forwprop where that test is needed. I'll remove it from this change to tree-vrp.c


+          if (vr->type == VR_RANGE
+             && operand_equal_p (vr->min, integer_zero_node, 0)
+             && operand_equal_p (vr->max, integer_one_node, 0))
+           {

Better use range_int_cst_p(vr) followed by compare_tree_int instead of
operand_equal_p IMHO.
Seems reasonable.


Print something to dump_file?
Happens via existing machinery. You'll get a Folded into ... message in the detail dumps. The testcase actually checks for this and also verifies the following DCE pass kills the dead code.

jeff


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