summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-copy.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-18 02:55:41 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-18 02:55:41 +0000
commit52dc45c89861df90e305cfd470df94e527e8c192 (patch)
treedc15d72c797cba9f36d3bcd1fbc6f1e7e6210d89 /gcc/tree-ssa-copy.c
parent6e9a4371f72c47837ec18b3d6ae8eb375487b242 (diff)
downloadgcc-52dc45c89861df90e305cfd470df94e527e8c192.tar.gz
Forgot to commit.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81969 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-copy.c')
-rw-r--r--gcc/tree-ssa-copy.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index ca9f0cce81a..e544992251c 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -272,11 +272,16 @@ cprop_into_stmt (tree stmt, varray_type const_and_copies)
/* CONST_AND_COPIES is a table which maps an SSA_NAME to the current
known value for that SSA_NAME (or NULL if no value is known).
- Propagate values from CONST_AND_COPIES into the PHI nodes of the
- successors of BB. */
+ NONZERO_VARS is the set SSA_NAMES known to have a nonzero value,
+ even if we don't know their precise value.
+
+ Propagate values from CONST_AND_COPIES and NONZERO_VARS into the PHI
+ nodes of the successors of BB. */
void
-cprop_into_successor_phis (basic_block bb, varray_type const_and_copies)
+cprop_into_successor_phis (basic_block bb,
+ varray_type const_and_copies,
+ bitmap nonzero_vars)
{
edge e;
@@ -342,6 +347,11 @@ cprop_into_successor_phis (basic_block bb, varray_type const_and_copies)
if (TREE_CODE (*orig_p) != SSA_NAME)
continue;
+ /* If the alternative is known to have a nonzero value, record
+ that fact in the PHI node itself for future use. */
+ if (bitmap_bit_p (nonzero_vars, SSA_NAME_VERSION (*orig_p)))
+ PHI_ARG_NONZERO (phi, i) = true;
+
/* If we have *ORIG_P in our constant/copy table, then replace
ORIG_P with its value in our constant/copy table. */
new = VARRAY_TREE (const_and_copies, SSA_NAME_VERSION (*orig_p));