diff options
author | Diego Novillo <dnovillo@redhat.com> | 2004-06-30 11:06:28 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@gcc.gnu.org> | 2004-06-30 07:06:28 -0400 |
commit | bddeccfe5d319972ef8dbf23b97870969654e8b1 (patch) | |
tree | fd198b1e6a301537b6f017c6edf424dc0fc22722 /gcc/tree-ssa-pre.c | |
parent | 9ac617d49582c168000b6e593e5c0b4bf2982ee0 (diff) | |
download | gcc-bddeccfe5d319972ef8dbf23b97870969654e8b1.zip gcc-bddeccfe5d319972ef8dbf23b97870969654e8b1.tar.gz gcc-bddeccfe5d319972ef8dbf23b97870969654e8b1.tar.bz2 |
tree-ssa-pre.c (phi_trans_add): Use is_gimple_min_invariant to check for constants.
* tree-ssa-pre.c (phi_trans_add): Use is_gimple_min_invariant
to check for constants.
(set_remove): Likewise.
(value_replace_in_set): Likewise.
(find_leader): Likewise.
* tree-vn.c (set_value_handle): Likewise.
(vn_lookup): Likewise.
(vn_lookup_or_add): Likewise.
From-SVN: r83902
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r-- | gcc/tree-ssa-pre.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index e9d888a..712c346 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -393,20 +393,9 @@ phi_trans_add (tree e, tree v, basic_block pred) void add_to_value (tree v, tree e) { - /* For values representing non-CST nodes, but still function - invariant things we mark TREE_CONSTANT as true and set the tree - chain to the actual constant. This is because unlike values - involving expressions, which are only available to use where the - expressions are live, a function invariant can be remade - anywhere, and thus, is available everywhere, just like a constant. */ - if (TREE_CODE_CLASS (TREE_CODE (v)) == 'c') + /* Constants have no expression sets. */ + if (is_gimple_min_invariant (v)) return; - else if (is_gimple_min_invariant (v)) - { - TREE_CONSTANT (v) = true; - TREE_CHAIN (v) = e; - return; - } if (VALUE_HANDLE_EXPR_SET (v) == NULL) VALUE_HANDLE_EXPR_SET (v) = set_new (false); @@ -565,14 +554,8 @@ set_remove (value_set_t set, tree expr) static bool set_contains_value (value_set_t set, tree val) { - /* All true constants are in every set. */ - if (TREE_CODE_CLASS (TREE_CODE (val)) == 'c') - return true; - /* This is only referring to the flag above that we set on - values referring to invariants, because we know that we - are dealing with one of the value handles we created. */ - - if (TREE_CONSTANT (val)) + /* All constants are in every set. */ + if (is_gimple_min_invariant (val)) return true; if (set->length == 0) @@ -679,7 +662,7 @@ value_insert_into_set (value_set_t set, tree expr) /* Constant and invariant values exist everywhere, and thus, actually keeping them in the sets is pointless. */ - if (TREE_CONSTANT (val)) + if (is_gimple_min_invariant (val)) return; if (!set_contains_value (set, val)) @@ -880,15 +863,10 @@ find_leader (value_set_t set, tree val) if (val == NULL) return NULL; - /* True constants represent themselves. */ - if (TREE_CODE_CLASS (TREE_CODE (val)) == 'c') + /* Constants represent themselves. */ + if (is_gimple_min_invariant (val)) return val; - /* Invariants are still represented by values, since they may be - more than a single _CST node. */ - if (TREE_CONSTANT (val)) - return TREE_CHAIN (val); - if (set->length == 0) return NULL; |