Revert previous patch:
2020-05-17 Aldy Hernandez <aldyh@redhat.com> * tree-vrp.c (operand_less_p): Move to... * vr-values.c (operand_less_p): ...here. * tree-vrp.h (operand_less_p): Remove.
This commit is contained in:
parent
8bfc81876f
commit
e7e785dfec
4 changed files with 36 additions and 26 deletions
|
@ -1,3 +1,12 @@
|
|||
2020-05-17 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
Revert:
|
||||
2020-05-17 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-vrp.c (operand_less_p): Move to...
|
||||
* vr-values.c (operand_less_p): ...here.
|
||||
* tree-vrp.h (operand_less_p): Remove.
|
||||
|
||||
2020-05-17 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* tree-vrp.c (operand_less_p): Move to...
|
||||
|
|
|
@ -685,6 +685,32 @@ build_symbolic_expr (tree type, tree sym, bool neg, tree inv)
|
|||
return build2 (pointer_p ? POINTER_PLUS_EXPR : PLUS_EXPR, type, t, inv);
|
||||
}
|
||||
|
||||
/* Return
|
||||
1 if VAL < VAL2
|
||||
0 if !(VAL < VAL2)
|
||||
-2 if those are incomparable. */
|
||||
int
|
||||
operand_less_p (tree val, tree val2)
|
||||
{
|
||||
/* LT is folded faster than GE and others. Inline the common case. */
|
||||
if (TREE_CODE (val) == INTEGER_CST && TREE_CODE (val2) == INTEGER_CST)
|
||||
return tree_int_cst_lt (val, val2);
|
||||
else if (TREE_CODE (val) == SSA_NAME && TREE_CODE (val2) == SSA_NAME)
|
||||
return val == val2 ? 0 : -2;
|
||||
else
|
||||
{
|
||||
int cmp = compare_values (val, val2);
|
||||
if (cmp == -1)
|
||||
return 1;
|
||||
else if (cmp == 0 || cmp == 1)
|
||||
return 0;
|
||||
else
|
||||
return -2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Compare two values VAL1 and VAL2. Return
|
||||
|
||||
-2 if VAL1 and VAL2 cannot be compared at compile-time,
|
||||
|
|
|
@ -116,6 +116,7 @@ extern bool range_int_cst_p (const value_range *);
|
|||
|
||||
extern int compare_values (tree, tree);
|
||||
extern int compare_values_warnv (tree, tree, bool *);
|
||||
extern int operand_less_p (tree, tree);
|
||||
|
||||
void range_fold_unary_expr (value_range *, enum tree_code, tree type,
|
||||
const value_range *, tree op0_type);
|
||||
|
|
|
@ -1104,32 +1104,6 @@ vr_values::check_for_binary_op_overflow (enum tree_code subcode, tree type,
|
|||
return true;
|
||||
}
|
||||
|
||||
/* Return
|
||||
1 if VAL < VAL2
|
||||
0 if !(VAL < VAL2)
|
||||
-2 if those are incomparable. */
|
||||
static int
|
||||
operand_less_p (tree val, tree val2)
|
||||
{
|
||||
/* LT is folded faster than GE and others. Inline the common case. */
|
||||
if (TREE_CODE (val) == INTEGER_CST && TREE_CODE (val2) == INTEGER_CST)
|
||||
return tree_int_cst_lt (val, val2);
|
||||
else if (TREE_CODE (val) == SSA_NAME && TREE_CODE (val2) == SSA_NAME)
|
||||
return val == val2 ? 0 : -2;
|
||||
else
|
||||
{
|
||||
int cmp = compare_values (val, val2);
|
||||
if (cmp == -1)
|
||||
return 1;
|
||||
else if (cmp == 0 || cmp == 1)
|
||||
return 0;
|
||||
else
|
||||
return -2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Try to derive a nonnegative or nonzero range out of STMT relying
|
||||
primarily on generic routines in fold in conjunction with range data.
|
||||
Store the result in *VR */
|
||||
|
|
Loading…
Add table
Reference in a new issue