summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-24 15:15:12 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-24 15:15:12 +0000
commiteee76ab40b6b0f428a99f856c16711d817fd1d7e (patch)
tree47962b28bfb768098636006dff42e5c52ac35f5b /gcc/tree-ssa-dom.c
parente75a380ac5b750a880def60580435a180710a176 (diff)
downloadgcc-eee76ab40b6b0f428a99f856c16711d817fd1d7e.tar.gz
* tree-ssa-dom.c (cprop_into_successor_phis): Remove code to
find the index of a PHI argument. Use e->dest_idx instead. Replace hint with index. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91166 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c39
1 files changed, 4 insertions, 35 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index d88d683154e..f257d2d9ce3 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2290,8 +2290,7 @@ cprop_into_successor_phis (basic_block bb, bitmap nonzero_vars)
FOR_EACH_EDGE (e, ei, bb->succs)
{
tree phi;
- int phi_num_args;
- int hint;
+ int index;
/* If this is an abnormal edge, then we do not want to copy propagate
into the PHI alternative associated with this edge. */
@@ -2302,46 +2301,16 @@ cprop_into_successor_phis (basic_block bb, bitmap nonzero_vars)
if (! phi)
continue;
- /* There is no guarantee that for any two PHI nodes in a block that
- the phi alternative associated with a particular edge will be
- at the same index in the phi alternative array.
-
- However, it is very likely they will be the same. So we keep
- track of the index of the alternative where we found the edge in
- the previous phi node and check that index first in the next
- phi node. If that hint fails, then we actually search all
- the entries. */
- phi_num_args = PHI_NUM_ARGS (phi);
- hint = phi_num_args;
+ index = e->dest_idx;
for ( ; phi; phi = PHI_CHAIN (phi))
{
- int i;
tree new;
use_operand_p orig_p;
tree orig;
- /* If the hint is valid (!= phi_num_args), see if it points
- us to the desired phi alternative. */
- if (hint != phi_num_args && PHI_ARG_EDGE (phi, hint) == e)
- ;
- else
- {
- /* The hint was either invalid or did not point to the
- correct phi alternative. Search all the alternatives
- for the correct one. Update the hint. */
- for (i = 0; i < phi_num_args; i++)
- if (PHI_ARG_EDGE (phi, i) == e)
- break;
- hint = i;
- }
-
- /* If we did not find the proper alternative, then something is
- horribly wrong. */
- gcc_assert (hint != phi_num_args);
-
/* The alternative may be associated with a constant, so verify
it is an SSA_NAME before doing anything with it. */
- orig_p = PHI_ARG_DEF_PTR (phi, hint);
+ orig_p = PHI_ARG_DEF_PTR (phi, index);
orig = USE_FROM_PTR (orig_p);
if (TREE_CODE (orig) != SSA_NAME)
continue;
@@ -2349,7 +2318,7 @@ cprop_into_successor_phis (basic_block bb, bitmap nonzero_vars)
/* 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)))
- PHI_ARG_NONZERO (phi, hint) = true;
+ PHI_ARG_NONZERO (phi, index) = true;
/* If we have *ORIG_P in our constant/copy table, then replace
ORIG_P with its value in our constant/copy table. */