This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Remove some (now) pointless current_loops checks


This removes the obvious ones.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2014-06-05  Richard Biener  <rguenther@suse.de>

	* cfgexpand.c (expand_gimple_cond): Remove check for current_loops.
	(construct_init_block): Likewise.
	(construct_exit_block): Likewise.
	(pass_expand::execute): Likewise.
	* graphite.c (graphite_transforms): Replace check for current_loops
	with a check for > 1 loops.
	(pass_graphite_transforms::execute): Adjust.
	* ipa-split.c (split_function): Remove check for current_loops.
	* omp-low.c (expand_parallel_call): Likewise.
	(expand_omp_for_init_counts): Likewise.
	(extract_omp_for_update_vars): Likewise.
	(expand_omp_for_generic): Likewise.
	(expand_omp_sections): Likewise.
	(expand_omp_target): Likewise.
	* tracer.c (tail_duplicate): Likewise.
	(pass_tracer::execute): Likewise.
	* trans-mem.c (expand_transaction): Likewise.
	* tree-complex.c (expand_complex_div_wide): Likewise.
	* tree-eh.c (lower_resx): Likewise.
	(cleanup_empty_eh_merge_phis): Likewise.
	* tree-predcom.c (run_tree_predictive_commoning): Replace check for
	current_loops with a check for > 1 loops.
	(pass_predcom::execute): Adjust.
	* tree-scalar-evolution.c (scev_reset): Remove check for current_loops.
	* tree-ssa-copy.c (copy_prop_visit_phi_node): Likewise.
	* tree-ssa-dom.c (pass_phi_only_cprop::execute): Likewise.
	* tree-ssa-tail-merge.c (tail_merge_optimize): Likewise.
	* tree-ssa-threadupdate.c (thread_through_all_blocks): Likewise.
	* tree-switch-conversion.c (process_switch): Likewise.
	* tree-tailcall.c (tree_optimize_tail_calls_1): Likewise.
	* tree-vrp.c (vrp_visit_phi_node): Likewise.
	(execute_vrp): Likewise.
	* ubsan.c (ubsan_expand_null_ifn): Likewise.

Index: trunk/gcc/cfgexpand.c
===================================================================
*** trunk.orig/gcc/cfgexpand.c	2014-06-03 12:09:30.292420262 +0200
--- trunk/gcc/cfgexpand.c	2014-06-05 14:48:59.157864386 +0200
*************** expand_gimple_cond (basic_block bb, gimp
*** 2170,2177 ****
    false_edge->flags |= EDGE_FALLTHRU;
    new_bb->count = false_edge->count;
    new_bb->frequency = EDGE_FREQUENCY (false_edge);
!   if (current_loops && bb->loop_father)
!     add_bb_to_loop (new_bb, bb->loop_father);
    new_edge = make_edge (new_bb, dest, 0);
    new_edge->probability = REG_BR_PROB_BASE;
    new_edge->count = new_bb->count;
--- 2170,2176 ----
    false_edge->flags |= EDGE_FALLTHRU;
    new_bb->count = false_edge->count;
    new_bb->frequency = EDGE_FREQUENCY (false_edge);
!   add_bb_to_loop (new_bb, bb->loop_father);
    new_edge = make_edge (new_bb, dest, 0);
    new_edge->probability = REG_BR_PROB_BASE;
    new_edge->count = new_bb->count;
*************** construct_init_block (void)
*** 5276,5283 ****
  				   ENTRY_BLOCK_PTR_FOR_FN (cfun));
    init_block->frequency = ENTRY_BLOCK_PTR_FOR_FN (cfun)->frequency;
    init_block->count = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
!   if (current_loops && ENTRY_BLOCK_PTR_FOR_FN (cfun)->loop_father)
!     add_bb_to_loop (init_block, ENTRY_BLOCK_PTR_FOR_FN (cfun)->loop_father);
    if (e)
      {
        first_block = e->dest;
--- 5275,5281 ----
  				   ENTRY_BLOCK_PTR_FOR_FN (cfun));
    init_block->frequency = ENTRY_BLOCK_PTR_FOR_FN (cfun)->frequency;
    init_block->count = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
!   add_bb_to_loop (init_block, ENTRY_BLOCK_PTR_FOR_FN (cfun)->loop_father);
    if (e)
      {
        first_block = e->dest;
*************** construct_exit_block (void)
*** 5355,5362 ****
    exit_block = create_basic_block (NEXT_INSN (head), end, prev_bb);
    exit_block->frequency = EXIT_BLOCK_PTR_FOR_FN (cfun)->frequency;
    exit_block->count = EXIT_BLOCK_PTR_FOR_FN (cfun)->count;
!   if (current_loops && EXIT_BLOCK_PTR_FOR_FN (cfun)->loop_father)
!     add_bb_to_loop (exit_block, EXIT_BLOCK_PTR_FOR_FN (cfun)->loop_father);
  
    ix = 0;
    while (ix < EDGE_COUNT (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds))
--- 5353,5359 ----
    exit_block = create_basic_block (NEXT_INSN (head), end, prev_bb);
    exit_block->frequency = EXIT_BLOCK_PTR_FOR_FN (cfun)->frequency;
    exit_block->count = EXIT_BLOCK_PTR_FOR_FN (cfun)->count;
!   add_bb_to_loop (exit_block, EXIT_BLOCK_PTR_FOR_FN (cfun)->loop_father);
  
    ix = 0;
    while (ix < EDGE_COUNT (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds))
*************** pass_expand::execute (function *fun)
*** 5821,5828 ****
    timevar_push (TV_POST_EXPAND);
    /* We are no longer in SSA form.  */
    fun->gimple_df->in_ssa_p = false;
!   if (current_loops)
!     loops_state_clear (LOOP_CLOSED_SSA);
  
    /* Expansion is used by optimization passes too, set maybe_hot_insn_p
       conservatively to true until they are all profile aware.  */
--- 5818,5824 ----
    timevar_push (TV_POST_EXPAND);
    /* We are no longer in SSA form.  */
    fun->gimple_df->in_ssa_p = false;
!   loops_state_clear (LOOP_CLOSED_SSA);
  
    /* Expansion is used by optimization passes too, set maybe_hot_insn_p
       conservatively to true until they are all profile aware.  */
Index: trunk/gcc/graphite.c
===================================================================
*** trunk.orig/gcc/graphite.c	2014-04-17 15:47:39.476100268 +0200
--- trunk/gcc/graphite.c	2014-06-05 15:07:33.271787680 +0200
*************** graphite_transform_loops (void)
*** 324,332 ****
  
  
  static unsigned int
! graphite_transforms (void)
  {
!   if (!current_loops)
      return 0;
  
    graphite_transform_loops ();
--- 324,332 ----
  
  
  static unsigned int
! graphite_transforms (struct function *fun)
  {
!   if (number_of_loops (fun) <= 1)
      return 0;
  
    graphite_transform_loops ();
*************** public:
*** 411,417 ****
  
    /* opt_pass methods: */
    virtual bool gate (function *) { return gate_graphite_transforms (); }
!   virtual unsigned int execute (function *) { return graphite_transforms (); }
  
  }; // class pass_graphite_transforms
  
--- 411,417 ----
  
    /* opt_pass methods: */
    virtual bool gate (function *) { return gate_graphite_transforms (); }
!   virtual unsigned int execute (function *fun) { return graphite_transforms (fun); }
  
  }; // class pass_graphite_transforms
  
Index: trunk/gcc/ipa-split.c
===================================================================
*** trunk.orig/gcc/ipa-split.c	2014-05-06 16:15:46.936961909 +0200
--- trunk/gcc/ipa-split.c	2014-06-05 14:51:32.477853830 +0200
*************** split_function (struct split_point *spli
*** 1177,1184 ****
        e = make_edge (new_return_bb, EXIT_BLOCK_PTR_FOR_FN (cfun), 0);
        e->probability = REG_BR_PROB_BASE;
        e->count = new_return_bb->count;
!       if (current_loops)
! 	add_bb_to_loop (new_return_bb, current_loops->tree_root);
        bitmap_set_bit (split_point->split_bbs, new_return_bb->index);
      }
    /* When we pass around the value, use existing return block.  */
--- 1177,1183 ----
        e = make_edge (new_return_bb, EXIT_BLOCK_PTR_FOR_FN (cfun), 0);
        e->probability = REG_BR_PROB_BASE;
        e->count = new_return_bb->count;
!       add_bb_to_loop (new_return_bb, current_loops->tree_root);
        bitmap_set_bit (split_point->split_bbs, new_return_bb->index);
      }
    /* When we pass around the value, use existing return block.  */
Index: trunk/gcc/omp-low.c
===================================================================
*** trunk.orig/gcc/omp-low.c	2014-05-26 09:57:04.525555605 +0200
--- trunk/gcc/omp-low.c	2014-06-05 14:52:17.721850715 +0200
*************** expand_parallel_call (struct omp_region
*** 4297,4307 ****
  
  	  make_edge (cond_bb, then_bb, EDGE_TRUE_VALUE);
  	  make_edge (cond_bb, else_bb, EDGE_FALSE_VALUE);
! 	  if (current_loops)
! 	    {
! 	      add_bb_to_loop (then_bb, cond_bb->loop_father);
! 	      add_bb_to_loop (else_bb, cond_bb->loop_father);
! 	    }
  	  e_then = make_edge (then_bb, bb, EDGE_FALLTHRU);
  	  e_else = make_edge (else_bb, bb, EDGE_FALLTHRU);
  
--- 4297,4304 ----
  
  	  make_edge (cond_bb, then_bb, EDGE_TRUE_VALUE);
  	  make_edge (cond_bb, else_bb, EDGE_FALSE_VALUE);
! 	  add_bb_to_loop (then_bb, cond_bb->loop_father);
! 	  add_bb_to_loop (else_bb, cond_bb->loop_father);
  	  e_then = make_edge (then_bb, bb, EDGE_FALLTHRU);
  	  e_else = make_edge (else_bb, bb, EDGE_FALLTHRU);
  
*************** expand_omp_for_init_counts (struct omp_f
*** 5021,5028 ****
  	    {
  	      first_zero_iter = i;
  	      zero_iter_bb = create_empty_bb (entry_bb);
! 	      if (current_loops)
! 		add_bb_to_loop (zero_iter_bb, entry_bb->loop_father);
  	      *gsi = gsi_after_labels (zero_iter_bb);
  	      stmt = gimple_build_assign (fd->loop.n2,
  					  build_zero_cst (type));
--- 5018,5024 ----
  	    {
  	      first_zero_iter = i;
  	      zero_iter_bb = create_empty_bb (entry_bb);
! 	      add_bb_to_loop (zero_iter_bb, entry_bb->loop_father);
  	      *gsi = gsi_after_labels (zero_iter_bb);
  	      stmt = gimple_build_assign (fd->loop.n2,
  					  build_zero_cst (type));
*************** extract_omp_for_update_vars (struct omp_
*** 5205,5212 ****
        tree vtype = TREE_TYPE (fd->loops[i].v);
  
        bb = create_empty_bb (last_bb);
!       if (current_loops)
! 	add_bb_to_loop (bb, last_bb->loop_father);
        gsi = gsi_start_bb (bb);
  
        if (i < fd->collapse - 1)
--- 5201,5207 ----
        tree vtype = TREE_TYPE (fd->loops[i].v);
  
        bb = create_empty_bb (last_bb);
!       add_bb_to_loop (bb, last_bb->loop_father);
        gsi = gsi_start_bb (bb);
  
        if (i < fd->collapse - 1)
*************** expand_omp_for_generic (struct omp_regio
*** 5693,5700 ****
        remove_edge (e);
  
        make_edge (cont_bb, l2_bb, EDGE_FALSE_VALUE);
!       if (current_loops)
! 	add_bb_to_loop (l2_bb, cont_bb->loop_father);
        e = find_edge (cont_bb, l1_bb);
        if (gimple_omp_for_combined_p (fd->for_stmt))
  	{
--- 5688,5694 ----
        remove_edge (e);
  
        make_edge (cont_bb, l2_bb, EDGE_FALSE_VALUE);
!       add_bb_to_loop (l2_bb, cont_bb->loop_father);
        e = find_edge (cont_bb, l1_bb);
        if (gimple_omp_for_combined_p (fd->for_stmt))
  	{
*************** expand_omp_sections (struct omp_region *
*** 7139,7146 ****
    t = gimple_block_label (default_bb);
    u = build_case_label (NULL, NULL, t);
    make_edge (l0_bb, default_bb, 0);
!   if (current_loops)
!     add_bb_to_loop (default_bb, current_loops->tree_root);
  
    stmt = gimple_build_switch (vmain, u, label_vec);
    gsi_insert_after (&switch_si, stmt, GSI_SAME_STMT);
--- 7133,7139 ----
    t = gimple_block_label (default_bb);
    u = build_case_label (NULL, NULL, t);
    make_edge (l0_bb, default_bb, 0);
!   add_bb_to_loop (default_bb, current_loops->tree_root);
  
    stmt = gimple_build_switch (vmain, u, label_vec);
    gsi_insert_after (&switch_si, stmt, GSI_SAME_STMT);
*************** expand_omp_target (struct omp_region *re
*** 8084,8094 ****
  
        make_edge (cond_bb, then_bb, EDGE_TRUE_VALUE);
        make_edge (cond_bb, else_bb, EDGE_FALSE_VALUE);
!       if (current_loops)
! 	{
! 	  add_bb_to_loop (then_bb, cond_bb->loop_father);
! 	  add_bb_to_loop (else_bb, cond_bb->loop_father);
! 	}
        make_edge (then_bb, new_bb, EDGE_FALLTHRU);
        make_edge (else_bb, new_bb, EDGE_FALLTHRU);
  
--- 8077,8084 ----
  
        make_edge (cond_bb, then_bb, EDGE_TRUE_VALUE);
        make_edge (cond_bb, else_bb, EDGE_FALSE_VALUE);
!       add_bb_to_loop (then_bb, cond_bb->loop_father);
!       add_bb_to_loop (else_bb, cond_bb->loop_father);
        make_edge (then_bb, new_bb, EDGE_FALLTHRU);
        make_edge (else_bb, new_bb, EDGE_FALLTHRU);
  
Index: trunk/gcc/tracer.c
===================================================================
*** trunk.orig/gcc/tracer.c	2014-05-06 16:15:43.025962178 +0200
--- trunk/gcc/tracer.c	2014-06-05 14:53:07.913847259 +0200
*************** tail_duplicate (void)
*** 316,323 ****
  	         of all do { } while loops.  Do not do that - it is
  		 not profitable and it might create a loop with multiple
  		 entries or at least rotate the loop.  */
! 	      && (!current_loops
! 		  || bb2->loop_father->header != bb2))
  	    {
  	      edge e;
  	      basic_block copy;
--- 316,322 ----
  	         of all do { } while loops.  Do not do that - it is
  		 not profitable and it might create a loop with multiple
  		 entries or at least rotate the loop.  */
! 	      && bb2->loop_father->header != bb2)
  	    {
  	      edge e;
  	      basic_block copy;
*************** pass_tracer::execute (function *fun)
*** 419,426 ****
      {
        free_dominance_info (CDI_DOMINATORS);
        /* If we changed the CFG schedule loops for fixup by cleanup_cfg.  */
!       if (current_loops)
! 	loops_state_set (LOOPS_NEED_FIXUP);
      }
  
    if (dump_file)
--- 418,424 ----
      {
        free_dominance_info (CDI_DOMINATORS);
        /* If we changed the CFG schedule loops for fixup by cleanup_cfg.  */
!       loops_state_set (LOOPS_NEED_FIXUP);
      }
  
    if (dump_file)
Index: trunk/gcc/trans-mem.c
===================================================================
*** trunk.orig/gcc/trans-mem.c	2014-06-02 09:41:39.855979517 +0200
--- trunk/gcc/trans-mem.c	2014-06-05 14:53:44.554844736 +0200
*************** expand_transaction (struct tm_region *re
*** 2745,2756 ****
        basic_block test_bb = create_empty_bb (transaction_bb);
        basic_block code_bb = create_empty_bb (test_bb);
        basic_block join_bb = create_empty_bb (code_bb);
!       if (current_loops && transaction_bb->loop_father)
! 	{
! 	  add_bb_to_loop (test_bb, transaction_bb->loop_father);
! 	  add_bb_to_loop (code_bb, transaction_bb->loop_father);
! 	  add_bb_to_loop (join_bb, transaction_bb->loop_father);
! 	}
        if (region->restart_block == region->entry_block)
  	region->restart_block = test_bb;
  
--- 2745,2753 ----
        basic_block test_bb = create_empty_bb (transaction_bb);
        basic_block code_bb = create_empty_bb (test_bb);
        basic_block join_bb = create_empty_bb (code_bb);
!       add_bb_to_loop (test_bb, transaction_bb->loop_father);
!       add_bb_to_loop (code_bb, transaction_bb->loop_father);
!       add_bb_to_loop (join_bb, transaction_bb->loop_father);
        if (region->restart_block == region->entry_block)
  	region->restart_block = test_bb;
  
*************** expand_transaction (struct tm_region *re
*** 2791,2798 ****
    if (abort_edge)
      {
        basic_block test_bb = create_empty_bb (transaction_bb);
!       if (current_loops && transaction_bb->loop_father)
! 	add_bb_to_loop (test_bb, transaction_bb->loop_father);
        if (region->restart_block == region->entry_block)
  	region->restart_block = test_bb;
  
--- 2788,2794 ----
    if (abort_edge)
      {
        basic_block test_bb = create_empty_bb (transaction_bb);
!       add_bb_to_loop (test_bb, transaction_bb->loop_father);
        if (region->restart_block == region->entry_block)
  	region->restart_block = test_bb;
  
*************** expand_transaction (struct tm_region *re
*** 2834,2841 ****
    if (inst_edge && uninst_edge)
      {
        basic_block test_bb = create_empty_bb (transaction_bb);
!       if (current_loops && transaction_bb->loop_father)
! 	add_bb_to_loop (test_bb, transaction_bb->loop_father);
        if (region->restart_block == region->entry_block)
  	region->restart_block = test_bb;
  
--- 2830,2836 ----
    if (inst_edge && uninst_edge)
      {
        basic_block test_bb = create_empty_bb (transaction_bb);
!       add_bb_to_loop (test_bb, transaction_bb->loop_father);
        if (region->restart_block == region->entry_block)
  	region->restart_block = test_bb;
  
*************** expand_transaction (struct tm_region *re
*** 2886,2893 ****
      {
        basic_block empty_bb = create_empty_bb (transaction_bb);
        region->restart_block = empty_bb;
!       if (current_loops && transaction_bb->loop_father)
! 	add_bb_to_loop (empty_bb, transaction_bb->loop_father);
  
        redirect_edge_pred (fallthru_edge, empty_bb);
        make_edge (transaction_bb, empty_bb, EDGE_FALLTHRU);
--- 2881,2887 ----
      {
        basic_block empty_bb = create_empty_bb (transaction_bb);
        region->restart_block = empty_bb;
!       add_bb_to_loop (empty_bb, transaction_bb->loop_father);
  
        redirect_edge_pred (fallthru_edge, empty_bb);
        make_edge (transaction_bb, empty_bb, EDGE_FALLTHRU);
Index: trunk/gcc/tree-complex.c
===================================================================
*** trunk.orig/gcc/tree-complex.c	2014-05-08 09:25:59.544757650 +0200
--- trunk/gcc/tree-complex.c	2014-06-05 14:54:11.303842895 +0200
*************** expand_complex_div_wide (gimple_stmt_ite
*** 1162,1172 ****
        make_edge (bb_cond, bb_false, EDGE_FALSE_VALUE);
        make_edge (bb_true, bb_join, EDGE_FALLTHRU);
        make_edge (bb_false, bb_join, EDGE_FALLTHRU);
!       if (current_loops)
! 	{
! 	  add_bb_to_loop (bb_true, bb_cond->loop_father);
! 	  add_bb_to_loop (bb_false, bb_cond->loop_father);
! 	}
  
        /* Update dominance info.  Note that bb_join's data was
           updated by split_block.  */
--- 1162,1169 ----
        make_edge (bb_cond, bb_false, EDGE_FALSE_VALUE);
        make_edge (bb_true, bb_join, EDGE_FALLTHRU);
        make_edge (bb_false, bb_join, EDGE_FALLTHRU);
!       add_bb_to_loop (bb_true, bb_cond->loop_father);
!       add_bb_to_loop (bb_false, bb_cond->loop_father);
  
        /* Update dominance info.  Note that bb_join's data was
           updated by split_block.  */
Index: trunk/gcc/tree-eh.c
===================================================================
*** trunk.orig/gcc/tree-eh.c	2014-05-19 10:55:33.134953791 +0200
--- trunk/gcc/tree-eh.c	2014-06-05 14:54:33.310841380 +0200
*************** lower_resx (basic_block bb, gimple stmt,
*** 3212,3219 ****
  	      gimple_stmt_iterator gsi2;
  
  	      new_bb = create_empty_bb (bb);
! 	      if (current_loops)
! 		add_bb_to_loop (new_bb, bb->loop_father);
  	      lab = gimple_block_label (new_bb);
  	      gsi2 = gsi_start_bb (new_bb);
  
--- 3212,3218 ----
  	      gimple_stmt_iterator gsi2;
  
  	      new_bb = create_empty_bb (bb);
! 	      add_bb_to_loop (new_bb, bb->loop_father);
  	      lab = gimple_block_label (new_bb);
  	      gsi2 = gsi_start_bb (new_bb);
  
*************** cleanup_empty_eh_merge_phis (basic_block
*** 4210,4217 ****
  	   we may have created a loop with multiple latches.
  	   All of this isn't easily fixed thus cancel the affected loop
  	   and mark the other loop as possibly having multiple latches.  */
! 	if (current_loops
! 	    && e->dest == e->dest->loop_father->header)
  	  {
  	    e->dest->loop_father->header = NULL;
  	    e->dest->loop_father->latch = NULL;
--- 4209,4215 ----
  	   we may have created a loop with multiple latches.
  	   All of this isn't easily fixed thus cancel the affected loop
  	   and mark the other loop as possibly having multiple latches.  */
! 	if (e->dest == e->dest->loop_father->header)
  	  {
  	    e->dest->loop_father->header = NULL;
  	    e->dest->loop_father->latch = NULL;
Index: trunk/gcc/tree-predcom.c
===================================================================
*** trunk.orig/gcc/tree-predcom.c	2014-05-07 09:58:50.867570462 +0200
--- trunk/gcc/tree-predcom.c	2014-06-05 14:55:49.735836118 +0200
*************** tree_predictive_commoning (void)
*** 2565,2573 ****
  /* Predictive commoning Pass.  */
  
  static unsigned
! run_tree_predictive_commoning (void)
  {
!   if (!current_loops)
      return 0;
  
    return tree_predictive_commoning ();
--- 2565,2573 ----
  /* Predictive commoning Pass.  */
  
  static unsigned
! run_tree_predictive_commoning (struct function *fun)
  {
!   if (number_of_loops (fun) <= 1)
      return 0;
  
    return tree_predictive_commoning ();
*************** public:
*** 2598,2606 ****
  
    /* opt_pass methods: */
    virtual bool gate (function *) { return flag_predictive_commoning != 0; }
!   virtual unsigned int execute (function *)
      {
!       return run_tree_predictive_commoning ();
      }
  
  }; // class pass_predcom
--- 2598,2606 ----
  
    /* opt_pass methods: */
    virtual bool gate (function *) { return flag_predictive_commoning != 0; }
!   virtual unsigned int execute (function *fun)
      {
!       return run_tree_predictive_commoning (fun);
      }
  
  }; // class pass_predcom
Index: trunk/gcc/tree-scalar-evolution.c
===================================================================
*** trunk.orig/gcc/tree-scalar-evolution.c	2014-05-19 10:55:29.997954007 +0200
--- trunk/gcc/tree-scalar-evolution.c	2014-06-05 14:56:03.681835158 +0200
*************** scev_reset (void)
*** 3197,3205 ****
  
    scev_reset_htab ();
  
-   if (!current_loops)
-     return;
- 
    FOR_EACH_LOOP (loop, 0)
      {
        loop->nb_iterations = NULL_TREE;
--- 3197,3202 ----
Index: trunk/gcc/tree-ssa-copy.c
===================================================================
*** trunk.orig/gcc/tree-ssa-copy.c	2014-05-06 16:15:46.945961908 +0200
--- trunk/gcc/tree-ssa-copy.c	2014-06-05 14:56:11.125834645 +0200
*************** copy_prop_visit_phi_node (gimple phi)
*** 406,413 ****
  	 ???  The value will be always loop invariant.
  	 In loop-closed SSA form do not copy-propagate through
  	 PHI nodes in blocks with a loop exit edge predecessor.  */
!       if (current_loops
! 	  && TREE_CODE (arg_value) == SSA_NAME
  	  && (loop_depth_of_name (arg_value) > loop_depth_of_name (lhs)
  	      || (loops_state_satisfies_p (LOOP_CLOSED_SSA)
  		  && loop_exit_edge_p (e->src->loop_father, e))))
--- 406,412 ----
  	 ???  The value will be always loop invariant.
  	 In loop-closed SSA form do not copy-propagate through
  	 PHI nodes in blocks with a loop exit edge predecessor.  */
!       if (TREE_CODE (arg_value) == SSA_NAME
  	  && (loop_depth_of_name (arg_value) > loop_depth_of_name (lhs)
  	      || (loops_state_satisfies_p (LOOP_CLOSED_SSA)
  		  && loop_exit_edge_p (e->src->loop_father, e))))
Index: trunk/gcc/tree-ssa-dom.c
===================================================================
*** trunk.orig/gcc/tree-ssa-dom.c	2014-05-21 13:51:17.049330784 +0200
--- trunk/gcc/tree-ssa-dom.c	2014-06-05 14:56:15.665834333 +0200
*************** pass_phi_only_cprop::execute (function *
*** 3128,3135 ****
      {
        free_dominance_info (CDI_DOMINATORS);
        /* If we changed the CFG schedule loops for fixup by cfgcleanup.  */
!       if (current_loops)
! 	loops_state_set (LOOPS_NEED_FIXUP);
      }
  
    /* Propagation of const and copies may make some EH edges dead.  Purge
--- 3128,3134 ----
      {
        free_dominance_info (CDI_DOMINATORS);
        /* If we changed the CFG schedule loops for fixup by cfgcleanup.  */
!       loops_state_set (LOOPS_NEED_FIXUP);
      }
  
    /* Propagation of const and copies may make some EH edges dead.  Purge
Index: trunk/gcc/tree-ssa-tail-merge.c
===================================================================
*** trunk.orig/gcc/tree-ssa-tail-merge.c	2014-05-20 12:18:18.324663408 +0200
--- trunk/gcc/tree-ssa-tail-merge.c	2014-06-05 14:57:33.514828973 +0200
*************** tail_merge_optimize (unsigned int todo)
*** 1663,1680 ****
    int max_iterations = PARAM_VALUE (PARAM_MAX_TAIL_MERGE_ITERATIONS);
  
    if (!flag_tree_tail_merge
!       || max_iterations == 0
!       /* We try to be conservative with respect to loop structure, since:
! 	 - the cases where tail-merging could both affect loop structure and be
! 	   beneficial are rare,
! 	 - it prevents us from having to fixup the loops using
! 	   loops_state_set (LOOPS_NEED_FIXUP), and
! 	 - keeping loop structure may allow us to simplify the pass.
! 	 In order to be conservative, we need loop information.	 In rare cases
! 	 (about 7 test-cases in the g++ testsuite) there is none (because
! 	 loop_optimizer_finalize has been called before tail-merge, and
! 	 PROP_loops is not set), so we bail out.  */
!       || current_loops == NULL)
      return 0;
  
    timevar_push (TV_TREE_TAIL_MERGE);
--- 1663,1669 ----
    int max_iterations = PARAM_VALUE (PARAM_MAX_TAIL_MERGE_ITERATIONS);
  
    if (!flag_tree_tail_merge
!       || max_iterations == 0)
      return 0;
  
    timevar_push (TV_TREE_TAIL_MERGE);
Index: trunk/gcc/tree-ssa-threadupdate.c
===================================================================
*** trunk.orig/gcc/tree-ssa-threadupdate.c	2014-05-05 11:48:41.259013793 +0200
--- trunk/gcc/tree-ssa-threadupdate.c	2014-06-05 14:57:46.461828081 +0200
*************** thread_through_all_blocks (bool may_peel
*** 1707,1715 ****
    bitmap threaded_blocks;
    struct loop *loop;
  
-   /* We must know about loops in order to preserve them.  */
-   gcc_assert (current_loops != NULL);
- 
    if (!paths.exists ())
      return false;
  
--- 1707,1712 ----
Index: trunk/gcc/tree-switch-conversion.c
===================================================================
*** trunk.orig/gcc/tree-switch-conversion.c	2014-05-07 09:58:52.375570359 +0200
--- trunk/gcc/tree-switch-conversion.c	2014-06-05 14:57:50.991827770 +0200
*************** process_switch (gimple swtch)
*** 1370,1377 ****
  	    fputs ("  expanding as bit test is preferable\n", dump_file);
  	  emit_case_bit_tests (swtch, info.index_expr,
  			       info.range_min, info.range_size);
! 	  if (current_loops)
! 	    loops_state_set (LOOPS_NEED_FIXUP);
  	  return NULL;
  	}
  
--- 1370,1376 ----
  	    fputs ("  expanding as bit test is preferable\n", dump_file);
  	  emit_case_bit_tests (swtch, info.index_expr,
  			       info.range_min, info.range_size);
! 	  loops_state_set (LOOPS_NEED_FIXUP);
  	  return NULL;
  	}
  
Index: trunk/gcc/tree-tailcall.c
===================================================================
*** trunk.orig/gcc/tree-tailcall.c	2014-05-06 16:15:43.027962178 +0200
--- trunk/gcc/tree-tailcall.c	2014-06-05 14:57:57.413827327 +0200
*************** tree_optimize_tail_calls_1 (bool opt_tai
*** 1059,1066 ****
    if (changed)
      {
        /* We may have created new loops.  Make them magically appear.  */
!       if (current_loops)
! 	loops_state_set (LOOPS_NEED_FIXUP);
        free_dominance_info (CDI_DOMINATORS);
      }
  
--- 1059,1065 ----
    if (changed)
      {
        /* We may have created new loops.  Make them magically appear.  */
!       loops_state_set (LOOPS_NEED_FIXUP);
        free_dominance_info (CDI_DOMINATORS);
      }
  
Index: trunk/gcc/tree-vrp.c
===================================================================
*** trunk.orig/gcc/tree-vrp.c	2014-06-03 12:57:07.802223526 +0200
--- trunk/gcc/tree-vrp.c	2014-06-05 14:58:09.214826515 +0200
*************** vrp_visit_phi_node (gimple phi)
*** 8598,8604 ****
  	 PHI node SCEV may known more about its value-range.  */
        if ((cmp_min > 0 || cmp_min < 0
  	   || cmp_max < 0 || cmp_max > 0)
- 	  && current_loops
  	  && (l = loop_containing_stmt (phi))
  	  && l->header == gimple_bb (phi))
  	adjust_range_with_scev (&vr_result, l, phi, lhs);
--- 8598,8603 ----
*************** execute_vrp (void)
*** 9999,10006 ****
    if (to_remove_edges.length () > 0)
      {
        free_dominance_info (CDI_DOMINATORS);
!       if (current_loops)
! 	loops_state_set (LOOPS_NEED_FIXUP);
      }
  
    to_remove_edges.release ();
--- 9998,10004 ----
    if (to_remove_edges.length () > 0)
      {
        free_dominance_info (CDI_DOMINATORS);
!       loops_state_set (LOOPS_NEED_FIXUP);
      }
  
    to_remove_edges.release ();
Index: trunk/gcc/ubsan.c
===================================================================
*** trunk.orig/gcc/ubsan.c	2014-05-26 09:57:06.817555447 +0200
--- trunk/gcc/ubsan.c	2014-06-05 14:58:17.080825973 +0200
*************** ubsan_expand_null_ifn (gimple_stmt_itera
*** 571,581 ****
    basic_block cond_bb = e->src;
    basic_block fallthru_bb = e->dest;
    basic_block then_bb = create_empty_bb (cond_bb);
!   if (current_loops)
!     {
!       add_bb_to_loop (then_bb, cond_bb->loop_father);
!       loops_state_set (LOOPS_NEED_FIXUP);
!     }
  
    /* Make an edge coming from the 'cond block' into the 'then block';
       this edge is unlikely taken, so set up the probability accordingly.  */
--- 571,578 ----
    basic_block cond_bb = e->src;
    basic_block fallthru_bb = e->dest;
    basic_block then_bb = create_empty_bb (cond_bb);
!   add_bb_to_loop (then_bb, cond_bb->loop_father);
!   loops_state_set (LOOPS_NEED_FIXUP);
  
    /* Make an edge coming from the 'cond block' into the 'then block';
       this edge is unlikely taken, so set up the probability accordingly.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]