diff options
author | Jeff Law <law@redhat.com> | 2016-01-15 15:32:05 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2016-01-15 15:32:05 -0700 |
commit | 40c43acacc1765416278e6636c20c5e3a78a7384 (patch) | |
tree | 0c5e0c93ef87ace7d5ef512867efe2303ef79439 /gcc/tree-ssa-dom.c | |
parent | cebeb718fed641f5c6b093e487c5e93c9b41ce02 (diff) | |
download | gcc-40c43acacc1765416278e6636c20c5e3a78a7384.zip gcc-40c43acacc1765416278e6636c20c5e3a78a7384.tar.gz gcc-40c43acacc1765416278e6636c20c5e3a78a7384.tar.bz2 |
re PR tree-optimization/69270 (DOM should exploit range information to create more equivalences)
PR tree-optimization/69270
* tree-ssanames.c (ssa_name_has_boolean_range): Moved here from
tree-ssa-dom.c. Improve test for [0..1] ranve from VRP.
* tree-ssa-dom.c (ssa_name_has_boolean_range): Remove.
* tree-ssanames.h (ssa_name_has_boolean_range): Prototype.
* tree-ssa-uncprop.c (associate_equivalences_with_edges): Use
ssa_name_has_boolean_range and constant_boolean_node.
PR tree-optimization/69270
* gcc.dg/tree-ssa/pr69270-2.c: New test.
* gcc.dg/tree-ssa/pr69270-3.c: New test.
From-SVN: r232453
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r-- | gcc/tree-ssa-dom.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index f2257b3..8298637 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -316,39 +316,6 @@ record_conditions (struct edge_info *edge_info, tree cond, tree inverted) edge_info->cond_equivalences.safe_push (c); } -/* Return TRUE is OP, an SSA_NAME has a range of values [0..1], false - otherwise. - - This can be because it is a boolean type, any unsigned integral - type with a single bit of precision, or has known range of [0..1] - via VRP analysis. */ - -static bool -ssa_name_has_boolean_range (tree op) -{ - /* Boolean types always have a range [0..1]. */ - if (TREE_CODE (TREE_TYPE (op)) == BOOLEAN_TYPE) - return true; - - /* An integral type with a single bit of precision. */ - if (INTEGRAL_TYPE_P (TREE_TYPE (op)) - && TYPE_UNSIGNED (TREE_TYPE (op)) - && TYPE_PRECISION (TREE_TYPE (op)) == 1) - return true; - - /* An integral type with more precision, but the object - only takes on values [0..1] as determined by VRP - analysis. */ - wide_int min, max; - if (INTEGRAL_TYPE_P (TREE_TYPE (op)) - && get_range_info (op, &min, &max) == VR_RANGE - && wi::eq_p (min, 0) - && wi::eq_p (max, 1)) - return true; - - return false; -} - /* We have finished optimizing BB, record any information implied by taking a specific outgoing edge from BB. */ |