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 superfluous condition in unroll_loop_runtime_iterations


Hello,

one of the conditioons in unroll_loop_runtime_iterations is
clearly always true (a result of rewriting that function 3 times :-). I
am removing it and commiting the change as obvious.

Zdenek

Changelog:
	* loop-unroll.c (unroll_loop_runtime_iterations): Remove
	superfluous condition.


Index: loop-unroll.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-unroll.c,v
retrieving revision 1.8
diff -c -3 -p -r1.8 loop-unroll.c
*** loop-unroll.c	17 Mar 2003 20:24:59 -0000	1.8
--- loop-unroll.c	11 May 2003 22:25:47 -0000
*************** unroll_loop_runtime_iterations (loops, l
*** 878,913 ****
  		DLTHE_FLAG_UPDATE_FREQ))
      	abort ();
  
!       if (i != n_peel)
! 	{
! 	  /* Create item for switch.  */
! 	  j = n_peel - i - (extra_zero_check ? 0 : 1);
! 	  p = REG_BR_PROB_BASE / (i + 2);
  
! 	  preheader = loop_split_edge_with (loop_preheader_edge (loop),
! 					    NULL_RTX, loops);
! 	  label = block_label (preheader);
! 	  start_sequence ();
! 	  do_compare_rtx_and_jump (copy_rtx (niter), GEN_INT (j), EQ, 0,
! 		    		   GET_MODE (desc->var), NULL_RTX, NULL_RTX,
! 				   label);
! 	  jump = get_last_insn ();
! 	  JUMP_LABEL (jump) = label;
! 	  REG_NOTES (jump)
! 		  = gen_rtx_EXPR_LIST (REG_BR_PROB,
! 			    	       GEN_INT (p), REG_NOTES (jump));
  	
! 	  LABEL_NUSES (label)++;
! 	  branch_code = get_insns ();
! 	  end_sequence ();
  
! 	  swtch = loop_split_edge_with (swtch->pred, branch_code, loops);
! 	  set_immediate_dominator (loops->cfg.dom, preheader, swtch);
! 	  swtch->succ->probability = REG_BR_PROB_BASE - p;
! 	  e = make_edge (swtch, preheader,
! 			 swtch->succ->flags & EDGE_IRREDUCIBLE_LOOP);
! 	  e->probability = p;
! 	}
      }
  
    if (extra_zero_check)
--- 878,910 ----
  		DLTHE_FLAG_UPDATE_FREQ))
      	abort ();
  
!       /* Create item for switch.  */
!       j = n_peel - i - (extra_zero_check ? 0 : 1);
!       p = REG_BR_PROB_BASE / (i + 2);
  
!       preheader = loop_split_edge_with (loop_preheader_edge (loop),
! 					NULL_RTX, loops);
!       label = block_label (preheader);
!       start_sequence ();
!       do_compare_rtx_and_jump (copy_rtx (niter), GEN_INT (j), EQ, 0,
! 			       GET_MODE (desc->var), NULL_RTX, NULL_RTX,
! 			       label);
!       jump = get_last_insn ();
!       JUMP_LABEL (jump) = label;
!       REG_NOTES (jump)
! 	      = gen_rtx_EXPR_LIST (REG_BR_PROB,
! 				   GEN_INT (p), REG_NOTES (jump));
  	
!       LABEL_NUSES (label)++;
!       branch_code = get_insns ();
!       end_sequence ();
  
!       swtch = loop_split_edge_with (swtch->pred, branch_code, loops);
!       set_immediate_dominator (loops->cfg.dom, preheader, swtch);
!       swtch->succ->probability = REG_BR_PROB_BASE - p;
!       e = make_edge (swtch, preheader,
! 		     swtch->succ->flags & EDGE_IRREDUCIBLE_LOOP);
!       e->probability = p;
      }
  
    if (extra_zero_check)


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