diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-09 12:02:29 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-09 12:02:29 +0000 |
commit | 40734805198ef874623eb7be9ec3de9251c799b7 (patch) | |
tree | 8dfb059637bc4dfe3718b626a8be035328c2a665 /gcc/ssa-ccp.c | |
parent | 1711184ff2dfbbd5aab7679d5e31159cd8d6d76d (diff) | |
download | gcc-40734805198ef874623eb7be9ec3de9251c799b7.tar.gz |
* sbitmap.c: Fix formatting.
* scan.c: Likewise.
* scan-decls.c: Likewise.
* sched-deps.c: Likewise.
* sched-ebb.c: Likewise.
* sched-rgn.c: Likewise.
* sched-vis.c: Likewise.
* sdbout.c: Likewise.
* sibcall.c: Likewise.
* simplify-rtx.c: Likewise.
* ssa.c: Likewise.
* ssa-ccp.c: Likewise.
* ssa-dce.c: Likewise.
* stmt.c: Likewise.
* stor-layout.c: Likewise.
* stringpool.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53324 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ssa-ccp.c')
-rw-r--r-- | gcc/ssa-ccp.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/gcc/ssa-ccp.c b/gcc/ssa-ccp.c index 4dc0aa9cfec..641727655ba 100644 --- a/gcc/ssa-ccp.c +++ b/gcc/ssa-ccp.c @@ -2,19 +2,19 @@ Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. Original framework by Daniel Berlin <dan@cgsoftware.com> Fleshed out and major cleanups by Jeff Law <law@redhat.com> - + This file is part of GCC. - + GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA @@ -44,7 +44,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 5. Another simple SSA DCE pass to remove dead code exposed by CCP. - When we exit, we are still in SSA form. + When we exit, we are still in SSA form. Potential further enhancements: @@ -83,7 +83,7 @@ typedef enum VARYING } latticevalue; -/* Main structure for CCP. +/* Main structure for CCP. Contains the lattice value and, if it's a constant, the constant value. */ @@ -185,7 +185,7 @@ visit_phi_node (phi_node, block) /* If the current value of PHI_NODE is UNDEFINED and one node in PHI_NODE is CONSTANT, then the new value of the PHI is that CONSTANT. Note this can turn into VARYING - if we find another distinct constant later. */ + if we find another distinct constant later. */ if (phi_node_lattice_val == UNDEFINED && phi_node_expr == NULL && current_parm_lattice_val == CONSTANT) @@ -288,7 +288,7 @@ visit_expression (insn, block) } /* Hard registers are not put in SSA form and thus we must consider - them varying. All the more reason to avoid hard registers in + them varying. All the more reason to avoid hard registers in RTL until as late as possible in the compilation. */ if (GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER) { @@ -451,7 +451,7 @@ visit_expression (insn, block) rtx simplified = NULL; /* We've got some kind of INSN. If it's simple, try to evaluate - it and record the results. + it and record the results. We already know this insn is a single_set and that it sets a pseudo register. So we just need to extract the source @@ -511,7 +511,7 @@ visit_expression (insn, block) defs_to_undefined (insn); break; } - + /* Simplify source operands to whatever known values they may have. */ if (GET_CODE (src0) == REG @@ -542,7 +542,7 @@ visit_expression (insn, block) defs_to_undefined (insn); break; } - + /* Simplify source operands to whatever known values they may have. */ if (GET_CODE (src0) == REG @@ -579,7 +579,7 @@ visit_expression (insn, block) defs_to_undefined (insn); break; } - + /* Simplify source operands to whatever known values they may have. */ if (GET_CODE (src0) == REG @@ -602,7 +602,7 @@ visit_expression (insn, block) src0, src1, src2); break; } - + default: defs_to_varying (insn); } @@ -617,7 +617,7 @@ visit_expression (insn, block) values[REGNO (dest)].const_value = simplified; } else - defs_to_varying (insn); + defs_to_varying (insn); } } @@ -665,11 +665,11 @@ examine_flow_edges () currinsn = NEXT_INSN (currinsn); } - + /* Don't forget the last insn in the block. */ if (INSN_P (currinsn)) visit_expression (currinsn, succ_block); - + /* If we haven't looked at the next block, and it has a single successor, add it onto the worklist. This is because if we only have one successor, we know it gets executed, @@ -702,7 +702,7 @@ follow_def_use_chains () /* Pick an entry off the worklist (it does not matter which entry we pick). */ - member = sbitmap_first_set_bit (ssa_edges); + member = sbitmap_first_set_bit (ssa_edges); RESET_BIT (ssa_edges, member); /* Iterate through all the uses of this entry. */ @@ -716,7 +716,7 @@ follow_def_use_chains () { if (TEST_BIT (executable_blocks, BLOCK_NUM (useinsn))) visit_phi_node (useinsn, BLOCK_FOR_INSN (useinsn)); - } + } else { if (TEST_BIT (executable_blocks, BLOCK_NUM (useinsn))) @@ -727,7 +727,7 @@ follow_def_use_chains () } /* Examine each edge to see if we were able to prove any were - not executable. + not executable. If an edge is not executable, then we can remove its alternative in PHI nodes as the destination of the edge, we can simplify the @@ -761,7 +761,7 @@ optimize_unexecutable_edges (edges, executable_edges) remove_phi_alternative (PATTERN (insn), edge->src); if (rtl_dump_file) fprintf (rtl_dump_file, - "Removing alternative for bb %d of phi %d\n", + "Removing alternative for bb %d of phi %d\n", edge->src->index, SSA_NAME (PATTERN (insn))); insn = NEXT_INSN (insn); } @@ -834,7 +834,7 @@ optimize_unexecutable_edges (edges, executable_edges) } } } - + /* Perform substitution of known values for pseudo registers. ??? Note we do not do simplifications or constant folding here, it @@ -842,7 +842,7 @@ optimize_unexecutable_edges (edges, executable_edges) anyway. Consider that if the simplification would result in an expression that produces a constant value that the value would have been discovered and recorded already. - + We perform two transformations. First, we initialize pseudos to their known constant values at their definition point. Second, we try to replace uses with the known constant value. */ @@ -901,13 +901,13 @@ ssa_ccp_substitute_constants () && (GET_CODE (useinsn) == INSN || GET_CODE (useinsn) == JUMP_INSN)) { - + if (validate_replace_src (regno_reg_rtx [i], values[i].const_value, useinsn)) { if (rtl_dump_file) - fprintf (rtl_dump_file, + fprintf (rtl_dump_file, "Register %d in insn %d replaced with constant\n", i, INSN_UID (useinsn)); INSN_CODE (useinsn) = -1; @@ -915,7 +915,7 @@ ssa_ccp_substitute_constants () BLOCK_FOR_INSN (useinsn), useinsn); } - + } } } @@ -1009,7 +1009,7 @@ ssa_const_prop () for (i = 0; i < VARRAY_SIZE (ssa_definition); i++) { if (i < FIRST_PSEUDO_REGISTER) - values[i].lattice_val = VARYING; + values[i].lattice_val = VARYING; else values[i].lattice_val = UNDEFINED; values[i].const_value = NULL; @@ -1085,7 +1085,7 @@ ssa_const_prop () sbitmap_free (ssa_edges); ssa_edges = NULL; - + free_edge_list (edges); edges = NULL; @@ -1178,7 +1178,7 @@ ssa_fast_dce (df) == NOTE_INSN_DELETED)) || side_effects_p (PATTERN (VARRAY_RTX (ssa_definition, reg)))) continue; - + /* Iterate over the uses of this register. If we can not find any uses that have not been deleted, then the definition of this register is dead. */ @@ -1200,7 +1200,7 @@ ssa_fast_dce (df) /* If we did not find a use of this register, then the definition of this register is dead. */ - + if (! found_use) { rtx def = VARRAY_RTX (ssa_definition, reg); @@ -1221,5 +1221,5 @@ ssa_fast_dce (df) /* Update the use-def chains in the df_analyzer as needed. */ df_analyse (df_analyzer, 0, - DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS); + DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS); } |