1 /* Dead code elimination pass for the GNU compiler.
2 Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
3 Contributed by Ben Elliston <bje@redhat.com>
4 and Andrew MacLeod <amacleod@redhat.com>
5 Adapted to use control dependence by Steven Bosscher, SUSE Labs.
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License as published by the
11 Free Software Foundation; either version 2, or (at your option) any
14 GCC is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING. If not, write to the Free
21 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
24 /* Dead code elimination.
28 Building an Optimizing Compiler,
29 Robert Morgan, Butterworth-Heinemann, 1998, Section 8.9.
31 Advanced Compiler Design and Implementation,
32 Steven Muchnick, Morgan Kaufmann, 1997, Section 18.10.
34 Dead-code elimination is the removal of statements which have no
35 impact on the program's output. "Dead statements" have no impact
36 on the program's output, while "necessary statements" may have
39 The algorithm consists of three phases:
40 1. Marking as necessary all statements known to be necessary,
41 e.g. most function calls, writing a value to memory, etc;
42 2. Propagating necessary statements, e.g., the statements
43 giving values to operands in necessary statements; and
44 3. Removing dead statements. */
48 #include "coretypes.h"
53 /* These RTL headers are needed for basic-block.h. */
56 #include "hard-reg-set.h"
57 #include "basic-block.h"
60 #include "diagnostic.h"
61 #include "tree-flow.h"
62 #include "tree-gimple.h"
63 #include "tree-dump.h"
64 #include "tree-pass.h"
68 static struct stmt_stats
76 static varray_type worklist
;
78 /* Vector indicating an SSA name has already been processed and marked
80 static sbitmap processed
;
82 /* Vector indicating that last_stmt if a basic block has already been
83 marked as necessary. */
84 static sbitmap last_stmt_necessary
;
86 /* Before we can determine whether a control branch is dead, we need to
87 compute which blocks are control dependent on which edges.
89 We expect each block to be control dependent on very few edges so we
90 use a bitmap for each block recording its edges. An array holds the
91 bitmap. The Ith bit in the bitmap is set if that block is dependent
93 bitmap
*control_dependence_map
;
95 /* Execute CODE for each edge (given number EDGE_NUMBER within the CODE)
96 for which the block with index N is control dependent. */
97 #define EXECUTE_IF_CONTROL_DEPENDENT(N, EDGE_NUMBER, CODE) \
98 EXECUTE_IF_SET_IN_BITMAP (control_dependence_map[N], 0, EDGE_NUMBER, CODE)
100 /* Local function prototypes. */
101 static inline void set_control_dependence_map_bit (basic_block
, int);
102 static inline void clear_control_dependence_bitmap (basic_block
);
103 static void find_all_control_dependences (struct edge_list
*);
104 static void find_control_dependence (struct edge_list
*, int);
105 static inline basic_block
find_pdom (basic_block
);
107 static inline void mark_stmt_necessary (tree
, bool);
108 static inline void mark_operand_necessary (tree
);
110 static bool need_to_preserve_store (tree
);
111 static void mark_stmt_if_obviously_necessary (tree
, bool);
112 static void find_obviously_necessary_stmts (struct edge_list
*);
114 static void mark_control_dependent_edges_necessary (basic_block
, struct edge_list
*);
115 static void propagate_necessity (struct edge_list
*);
117 static void eliminate_unnecessary_stmts (void);
118 static void remove_dead_phis (basic_block
);
119 static void remove_dead_stmt (block_stmt_iterator
*, basic_block
);
121 static void print_stats (void);
122 static void tree_dce_init (bool);
123 static void tree_dce_done (bool);
125 /* Indicate block BB is control dependent on an edge with index EDGE_INDEX. */
127 set_control_dependence_map_bit (basic_block bb
, int edge_index
)
129 if (bb
== ENTRY_BLOCK_PTR
)
131 if (bb
== EXIT_BLOCK_PTR
)
133 bitmap_set_bit (control_dependence_map
[bb
->index
], edge_index
);
136 /* Clear all control dependences for block BB. */
138 void clear_control_dependence_bitmap (basic_block bb
)
140 bitmap_clear (control_dependence_map
[bb
->index
]);
143 /* Record all blocks' control dependences on all edges in the edge
144 list EL, ala Morgan, Section 3.6. */
147 find_all_control_dependences (struct edge_list
*el
)
151 for (i
= 0; i
< NUM_EDGES (el
); ++i
)
152 find_control_dependence (el
, i
);
155 /* Determine all blocks' control dependences on the given edge with edge_list
156 EL index EDGE_INDEX, ala Morgan, Section 3.6. */
159 find_control_dependence (struct edge_list
*el
, int edge_index
)
161 basic_block current_block
;
162 basic_block ending_block
;
164 #ifdef ENABLE_CHECKING
165 if (INDEX_EDGE_PRED_BB (el
, edge_index
) == EXIT_BLOCK_PTR
)
169 if (INDEX_EDGE_PRED_BB (el
, edge_index
) == ENTRY_BLOCK_PTR
)
170 ending_block
= ENTRY_BLOCK_PTR
->next_bb
;
172 ending_block
= find_pdom (INDEX_EDGE_PRED_BB (el
, edge_index
));
174 for (current_block
= INDEX_EDGE_SUCC_BB (el
, edge_index
);
175 current_block
!= ending_block
&& current_block
!= EXIT_BLOCK_PTR
;
176 current_block
= find_pdom (current_block
))
178 edge e
= INDEX_EDGE (el
, edge_index
);
180 /* For abnormal edges, we don't make current_block control
181 dependent because instructions that throw are always necessary
183 if (e
->flags
& EDGE_ABNORMAL
)
186 set_control_dependence_map_bit (current_block
, edge_index
);
190 /* Find the immediate postdominator PDOM of the specified basic block BLOCK.
191 This function is necessary because some blocks have negative numbers. */
193 static inline basic_block
194 find_pdom (basic_block block
)
196 if (block
== ENTRY_BLOCK_PTR
)
198 else if (block
== EXIT_BLOCK_PTR
)
199 return EXIT_BLOCK_PTR
;
202 basic_block bb
= get_immediate_dominator (CDI_POST_DOMINATORS
, block
);
204 return EXIT_BLOCK_PTR
;
209 #define NECESSARY(stmt) stmt->common.asm_written_flag
211 /* If STMT is not already marked necessary, mark it, and add it to the
212 worklist if ADD_TO_WORKLIST is true. */
214 mark_stmt_necessary (tree stmt
, bool add_to_worklist
)
216 #ifdef ENABLE_CHECKING
218 || stmt
== error_mark_node
219 || (stmt
&& DECL_P (stmt
)))
223 if (NECESSARY (stmt
))
226 if (dump_file
&& (dump_flags
& TDF_DETAILS
))
228 fprintf (dump_file
, "Marking useful stmt: ");
229 print_generic_stmt (dump_file
, stmt
, TDF_SLIM
);
230 fprintf (dump_file
, "\n");
233 NECESSARY (stmt
) = 1;
235 VARRAY_PUSH_TREE (worklist
, stmt
);
238 /* Mark the statement defining operand OP as necessary. */
241 mark_operand_necessary (tree op
)
246 #ifdef ENABLE_CHECKING
251 ver
= SSA_NAME_VERSION (op
);
252 if (TEST_BIT (processed
, ver
))
254 SET_BIT (processed
, ver
);
256 stmt
= SSA_NAME_DEF_STMT (op
);
257 #ifdef ENABLE_CHECKING
263 || IS_EMPTY_STMT (stmt
))
266 NECESSARY (stmt
) = 1;
267 VARRAY_PUSH_TREE (worklist
, stmt
);
270 /* Return true if a store to a variable needs to be preserved. */
273 need_to_preserve_store (tree ssa_name
)
275 return (needs_to_live_in_memory (SSA_NAME_VAR (ssa_name
)));
279 /* Mark STMT as necessary if it is obviously is. Add it to the worklist if
280 it can make other statements necessary.
282 If AGGRESSIVE is false, control statements are conservatively marked as
286 mark_stmt_if_obviously_necessary (tree stmt
, bool aggressive
)
289 v_may_def_optype v_may_defs
;
290 v_must_def_optype v_must_defs
;
294 /* Statements that are implicitly live. Most function calls, asm and return
295 statements are required. Labels and BIND_EXPR nodes are kept because
296 they are control flow, and we have no way of knowing whether they can be
297 removed. DCE can eliminate all the other statements in a block, and CFG
298 can then remove the block and labels. */
299 switch (TREE_CODE (stmt
))
303 case CASE_LABEL_EXPR
:
304 mark_stmt_necessary (stmt
, false);
310 mark_stmt_necessary (stmt
, true);
314 /* Most, but not all function calls are required. Function calls that
315 produce no result and have no side effects (i.e. const pure
316 functions) are unnecessary. */
317 if (TREE_SIDE_EFFECTS (stmt
))
318 mark_stmt_necessary (stmt
, true);
322 if (TREE_CODE (TREE_OPERAND (stmt
, 1)) == CALL_EXPR
323 && TREE_SIDE_EFFECTS (TREE_OPERAND (stmt
, 1)))
325 mark_stmt_necessary (stmt
, true);
329 /* These values are mildly magic bits of the EH runtime. We can't
330 see the entire lifetime of these values until landing pads are
332 if (TREE_CODE (TREE_OPERAND (stmt
, 0)) == EXC_PTR_EXPR
333 || TREE_CODE (TREE_OPERAND (stmt
, 0)) == FILTER_EXPR
)
335 mark_stmt_necessary (stmt
, true);
341 if (! simple_goto_p (stmt
))
342 mark_stmt_necessary (stmt
, true);
346 if (GOTO_DESTINATION (COND_EXPR_THEN (stmt
))
347 == GOTO_DESTINATION (COND_EXPR_ELSE (stmt
)))
349 /* A COND_EXPR is obviously dead if the target labels are the same.
350 We cannot kill the statement at this point, so to prevent the
351 statement from being marked necessary, we replace the condition
352 with a constant. The stmt is killed later on in cfg_cleanup. */
353 COND_EXPR_COND (stmt
) = integer_zero_node
;
361 mark_stmt_necessary (stmt
, true);
368 ann
= stmt_ann (stmt
);
369 /* If the statement has volatile operands, it needs to be preserved. Same
370 for statements that can alter control flow in unpredictable ways. */
371 if (ann
->has_volatile_ops
372 || is_ctrl_altering_stmt (stmt
))
374 mark_stmt_necessary (stmt
, true);
378 get_stmt_operands (stmt
);
380 defs
= DEF_OPS (ann
);
381 for (i
= 0; i
< NUM_DEFS (defs
); i
++)
383 tree def
= DEF_OP (defs
, i
);
384 if (need_to_preserve_store (def
))
386 mark_stmt_necessary (stmt
, true);
391 v_may_defs
= V_MAY_DEF_OPS (ann
);
392 for (i
= 0; i
< NUM_V_MAY_DEFS (v_may_defs
); i
++)
394 tree v_may_def
= V_MAY_DEF_RESULT (v_may_defs
, i
);
395 if (need_to_preserve_store (v_may_def
))
397 mark_stmt_necessary (stmt
, true);
402 v_must_defs
= V_MUST_DEF_OPS (ann
);
403 for (i
= 0; i
< NUM_V_MUST_DEFS (v_must_defs
); i
++)
405 tree v_must_def
= V_MUST_DEF_OP (v_must_defs
, i
);
406 if (need_to_preserve_store (v_must_def
))
408 mark_stmt_necessary (stmt
, true);
416 /* Find obviously necessary statements. These are things like most function
417 calls, and stores to file level variables.
419 If EL is NULL, control statements are conservatively marked as
420 necessary. Otherwise it contains the list of edges used by control
421 dependence analysis. */
424 find_obviously_necessary_stmts (struct edge_list
*el
)
427 block_stmt_iterator i
;
434 /* Check any PHI nodes in the block. */
435 for (phi
= phi_nodes (bb
); phi
; phi
= TREE_CHAIN (phi
))
439 /* PHIs for virtual variables do not directly affect code
440 generation and need not be considered inherently necessary
441 regardless of the bits set in their decl.
443 Thus, we only need to mark PHIs for real variables which
444 need their result preserved as being inherently necessary. */
445 if (is_gimple_reg (PHI_RESULT (phi
))
446 && need_to_preserve_store (PHI_RESULT (phi
)))
447 mark_stmt_necessary (phi
, true);
450 /* Check all statements in the block. */
451 for (i
= bsi_start (bb
); ! bsi_end_p (i
); bsi_next (&i
))
453 tree stmt
= bsi_stmt (i
);
454 NECESSARY (stmt
) = 0;
455 mark_stmt_if_obviously_necessary (stmt
, el
!= NULL
);
458 /* Mark this basic block as `not visited'. A block will be marked
459 visited when the edges that it is control dependent on have been
461 bb
->flags
&= ~BB_VISITED
;
466 /* Prevent the loops from being removed. We must keep the infinite loops,
467 and we currently do not have a means to recognize the finite ones. */
470 for (e
= bb
->succ
; e
; e
= e
->succ_next
)
471 if (e
->flags
& EDGE_DFS_BACK
)
472 mark_control_dependent_edges_necessary (e
->dest
, el
);
477 /* Make corresponding control dependent edges necessary. We only
478 have to do this once for each basic block, so we clear the bitmap
481 mark_control_dependent_edges_necessary (basic_block bb
, struct edge_list
*el
)
485 #ifdef ENABLE_CHECKING
486 if (bb
== EXIT_BLOCK_PTR
)
490 if (bb
== ENTRY_BLOCK_PTR
)
493 EXECUTE_IF_CONTROL_DEPENDENT (bb
->index
, edge_number
,
496 basic_block cd_bb
= INDEX_EDGE_PRED_BB (el
, edge_number
);
498 if (TEST_BIT (last_stmt_necessary
, cd_bb
->index
))
500 SET_BIT (last_stmt_necessary
, cd_bb
->index
);
502 t
= last_stmt (cd_bb
);
503 if (is_ctrl_stmt (t
))
504 mark_stmt_necessary (t
, true);
508 /* Propagate necessity using the operands of necessary statements. Process
509 the uses on each statement in the worklist, and add all feeding statements
510 which contribute to the calculation of this value to the worklist.
512 In conservative mode, EL is NULL. */
515 propagate_necessity (struct edge_list
*el
)
518 bool aggressive
= (el
? true : false);
520 if (dump_file
&& (dump_flags
& TDF_DETAILS
))
521 fprintf (dump_file
, "\nProcessing worklist:\n");
523 while (VARRAY_ACTIVE_SIZE (worklist
) > 0)
525 /* Take `i' from worklist. */
526 i
= VARRAY_TOP_TREE (worklist
);
527 VARRAY_POP (worklist
);
529 if (dump_file
&& (dump_flags
& TDF_DETAILS
))
531 fprintf (dump_file
, "processing: ");
532 print_generic_stmt (dump_file
, i
, TDF_SLIM
);
533 fprintf (dump_file
, "\n");
538 /* Mark the last statements of the basic blocks that the block
539 containing `i' is control dependent on, but only if we haven't
541 basic_block bb
= bb_for_stmt (i
);
542 if (! (bb
->flags
& BB_VISITED
))
544 bb
->flags
|= BB_VISITED
;
545 mark_control_dependent_edges_necessary (bb
, el
);
549 if (TREE_CODE (i
) == PHI_NODE
)
551 /* PHI nodes are somewhat special in that each PHI alternative has
552 data and control dependencies. All the statements feeding the
553 PHI node's arguments are always necessary. In aggressive mode,
554 we also consider the control dependent edges leading to the
555 predecessor block associated with each PHI alternative as
558 for (k
= 0; k
< PHI_NUM_ARGS (i
); k
++)
560 tree arg
= PHI_ARG_DEF (i
, k
);
561 if (TREE_CODE (arg
) == SSA_NAME
)
562 mark_operand_necessary (arg
);
567 for (k
= 0; k
< PHI_NUM_ARGS (i
); k
++)
569 basic_block arg_bb
= PHI_ARG_EDGE (i
, k
)->src
;
570 if (! (arg_bb
->flags
& BB_VISITED
))
572 arg_bb
->flags
|= BB_VISITED
;
573 mark_control_dependent_edges_necessary (arg_bb
, el
);
580 /* Propagate through the operands. Examine all the USE, VUSE and
581 V_MAY_DEF operands in this statement. Mark all the statements
582 which feed this statement's uses as necessary. */
584 v_may_def_optype v_may_defs
;
589 get_stmt_operands (i
);
592 uses
= USE_OPS (ann
);
593 for (k
= 0; k
< NUM_USES (uses
); k
++)
594 mark_operand_necessary (USE_OP (uses
, k
));
596 vuses
= VUSE_OPS (ann
);
597 for (k
= 0; k
< NUM_VUSES (vuses
); k
++)
598 mark_operand_necessary (VUSE_OP (vuses
, k
));
600 /* The operands of V_MAY_DEF expressions are also needed as they
601 represent potential definitions that may reach this
602 statement (V_MAY_DEF operands allow us to follow def-def
604 v_may_defs
= V_MAY_DEF_OPS (ann
);
605 for (k
= 0; k
< NUM_V_MAY_DEFS (v_may_defs
); k
++)
606 mark_operand_necessary (V_MAY_DEF_OP (v_may_defs
, k
));
611 /* Eliminate unnecessary statements. Any instruction not marked as necessary
612 contributes nothing to the program, and can be deleted. */
615 eliminate_unnecessary_stmts (void)
618 block_stmt_iterator i
;
620 if (dump_file
&& (dump_flags
& TDF_DETAILS
))
621 fprintf (dump_file
, "\nEliminating unnecessary statements:\n");
623 clear_special_calls ();
626 /* Remove dead PHI nodes. */
627 remove_dead_phis (bb
);
629 /* Remove dead statements. */
630 for (i
= bsi_start (bb
); ! bsi_end_p (i
) ; )
632 tree t
= bsi_stmt (i
);
636 /* If `i' is not necessary then remove it. */
638 remove_dead_stmt (&i
, bb
);
641 if (TREE_CODE (t
) == CALL_EXPR
)
642 notice_special_calls (t
);
643 else if (TREE_CODE (t
) == MODIFY_EXPR
644 && TREE_CODE (TREE_OPERAND (t
, 1)) == CALL_EXPR
)
645 notice_special_calls (TREE_OPERAND (t
, 1));
652 /* Remove dead PHI nodes from block BB. */
655 remove_dead_phis (basic_block bb
)
660 phi
= phi_nodes (bb
);
665 if (! NECESSARY (phi
))
667 tree next
= TREE_CHAIN (phi
);
669 if (dump_file
&& (dump_flags
& TDF_DETAILS
))
671 fprintf (dump_file
, "Deleting : ");
672 print_generic_stmt (dump_file
, phi
, TDF_SLIM
);
673 fprintf (dump_file
, "\n");
676 remove_phi_node (phi
, prev
, bb
);
677 stats
.removed_phis
++;
683 phi
= TREE_CHAIN (phi
);
688 /* Remove dead statement pointed by iterator I. Receives the basic block BB
689 containing I so that we don't have to look it up. */
692 remove_dead_stmt (block_stmt_iterator
*i
, basic_block bb
)
694 tree t
= bsi_stmt (*i
);
696 if (dump_file
&& (dump_flags
& TDF_DETAILS
))
698 fprintf (dump_file
, "Deleting : ");
699 print_generic_stmt (dump_file
, t
, TDF_SLIM
);
700 fprintf (dump_file
, "\n");
705 /* If we have determined that a conditional branch statement contributes
706 nothing to the program, then we not only remove it, but we also change
707 the flow graph so that the current block will simply fall-thru to its
708 immediate post-dominator. The blocks we are circumventing will be
709 removed by cleaup_cfg if this change in the flow graph makes them
711 if (is_ctrl_stmt (t
))
713 basic_block post_dom_bb
;
715 #ifdef ENABLE_CHECKING
716 /* The post dominance info has to be up-to-date. */
717 if (dom_computed
[CDI_POST_DOMINATORS
] != DOM_OK
)
720 /* Get the immediate post dominator of bb. */
721 post_dom_bb
= get_immediate_dominator (CDI_POST_DOMINATORS
, bb
);
722 /* Some blocks don't have an immediate post dominator. This can happen
723 for example with infinite loops. Removing an infinite loop is an
724 inappropriate transformation anyway... */
731 /* Redirect the first edge out of BB to reach POST_DOM_BB. */
732 redirect_edge_and_branch (bb
->succ
, post_dom_bb
);
733 PENDING_STMT (bb
->succ
) = NULL
;
735 /* The edge is no longer associated with a conditional, so it does
736 not have TRUE/FALSE flags. */
737 bb
->succ
->flags
&= ~(EDGE_TRUE_VALUE
| EDGE_FALSE_VALUE
);
739 /* If the edge reaches any block other than the exit, then it is a
740 fallthru edge; if it reaches the exit, then it is not a fallthru
742 if (post_dom_bb
!= EXIT_BLOCK_PTR
)
743 bb
->succ
->flags
|= EDGE_FALLTHRU
;
745 bb
->succ
->flags
&= ~EDGE_FALLTHRU
;
747 /* Remove the remaining the outgoing edges. */
748 for (e
= bb
->succ
->succ_next
; e
!= NULL
;)
759 /* Print out removed statement statistics. */
764 if (dump_file
&& (dump_flags
& (TDF_STATS
|TDF_DETAILS
)))
768 percg
= ((float) stats
.removed
/ (float) stats
.total
) * 100;
769 fprintf (dump_file
, "Removed %d of %d statements (%d%%)\n",
770 stats
.removed
, stats
.total
, (int) percg
);
772 if (stats
.total_phis
== 0)
775 percg
= ((float) stats
.removed_phis
/ (float) stats
.total_phis
) * 100;
777 fprintf (dump_file
, "Removed %d of %d PHI nodes (%d%%)\n",
778 stats
.removed_phis
, stats
.total_phis
, (int) percg
);
782 /* Initialization for this pass. Set up the used data structures. */
785 tree_dce_init (bool aggressive
)
787 memset ((void *) &stats
, 0, sizeof (stats
));
793 control_dependence_map
794 = xmalloc (last_basic_block
* sizeof (bitmap
));
795 for (i
= 0; i
< last_basic_block
; ++i
)
796 control_dependence_map
[i
] = BITMAP_XMALLOC ();
798 last_stmt_necessary
= sbitmap_alloc (last_basic_block
);
799 sbitmap_zero (last_stmt_necessary
);
802 processed
= sbitmap_alloc (num_ssa_names
+ 1);
803 sbitmap_zero (processed
);
805 VARRAY_TREE_INIT (worklist
, 64, "work list");
808 /* Cleanup after this pass. */
811 tree_dce_done (bool aggressive
)
817 for (i
= 0; i
< last_basic_block
; ++i
)
818 BITMAP_XFREE (control_dependence_map
[i
]);
819 free (control_dependence_map
);
821 sbitmap_free (last_stmt_necessary
);
824 sbitmap_free (processed
);
827 /* Main routine to eliminate dead code.
829 AGGRESSIVE controls the aggressiveness of the algorithm.
830 In conservative mode, we ignore control dependence and simply declare
831 all but the most trivially dead branches necessary. This mode is fast.
832 In aggressive mode, control dependences are taken into account, which
833 results in more dead code elimination, but at the cost of some time.
835 FIXME: Aggressive mode before PRE doesn't work currently because
836 the dominance info is not invalidated after DCE1. This is
837 not an issue right now because we only run aggressive DCE
838 as the last tree SSA pass, but keep this in mind when you
839 start experimenting with pass ordering. */
842 perform_tree_ssa_dce (bool aggressive
)
844 struct edge_list
*el
= NULL
;
846 tree_dce_init (aggressive
);
850 /* Compute control dependence. */
851 timevar_push (TV_CONTROL_DEPENDENCES
);
852 calculate_dominance_info (CDI_POST_DOMINATORS
);
853 el
= create_edge_list ();
854 find_all_control_dependences (el
);
855 timevar_pop (TV_CONTROL_DEPENDENCES
);
857 mark_dfs_back_edges ();
860 find_obviously_necessary_stmts (el
);
862 propagate_necessity (el
);
864 eliminate_unnecessary_stmts ();
867 free_dominance_info (CDI_POST_DOMINATORS
);
871 /* Debugging dumps. */
874 dump_function_to_file (current_function_decl
, dump_file
, dump_flags
);
878 tree_dce_done (aggressive
);
883 /* Pass entry points. */
887 perform_tree_ssa_dce (/*aggressive=*/false);
891 tree_ssa_cd_dce (void)
893 perform_tree_ssa_dce (/*aggressive=*/optimize
>= 2);
899 return flag_tree_dce
!= 0;
902 struct tree_opt_pass pass_dce
=
906 tree_ssa_dce
, /* execute */
909 0, /* static_pass_number */
910 TV_TREE_DCE
, /* tv_id */
911 PROP_cfg
| PROP_ssa
, /* properties_required */
912 0, /* properties_provided */
913 0, /* properties_destroyed */
914 0, /* todo_flags_start */
915 TODO_ggc_collect
| TODO_verify_ssa
/* todo_flags_finish */
918 struct tree_opt_pass pass_cd_dce
=
922 tree_ssa_cd_dce
, /* execute */
925 0, /* static_pass_number */
926 TV_TREE_CD_DCE
, /* tv_id */
927 PROP_cfg
| PROP_ssa
, /* properties_required */
928 0, /* properties_provided */
929 0, /* properties_destroyed */
930 0, /* todo_flags_start */
931 TODO_ggc_collect
| TODO_verify_ssa
| TODO_verify_flow
932 /* todo_flags_finish */