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]

[lno] Some fixes


Hello,

this patch

-- fixes handling of casts in instantiate_parameters
-- prevents us from emitting unnecessary phi nodes for loop closed
   ssa form
-- removes the unnecessary call to create_preheaders from
   tree_ssa_loop_opt (it is already called from loop_optimizer_init.

Zdenek

Index: ChangeLog.lno
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/ChangeLog.lno,v
retrieving revision 1.1.2.138
diff -c -3 -p -r1.1.2.138 ChangeLog.lno
*** ChangeLog.lno	20 Apr 2004 17:39:43 -0000	1.1.2.138
--- ChangeLog.lno	21 Apr 2004 07:50:57 -0000
***************
*** 1,3 ****
--- 1,11 ----
+ 2004-04-21  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+ 
+ 	* tree-scalar-evolution.c (instantiate_parameters): Handle casts
+ 	correctly.
+ 	* tree-ssa-loop-manip.c (add_exit_phis_edge): Do not add unnecessary
+ 	phi nodes.
+ 	* tree-ssa-loop.c (tree_ssa_loop_opt): Do not call create_preheaders.
+ 
  2004-04-20  Sebastian Pop  <sebastian.pop@ensmp.fr>
  
  	* tree-scalar-evolution.c (scev_info_str, new_scev_info_str, 
Index: tree-scalar-evolution.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-scalar-evolution.c,v
retrieving revision 1.1.2.35
diff -c -3 -p -r1.1.2.35 tree-scalar-evolution.c
*** tree-scalar-evolution.c	20 Apr 2004 17:39:43 -0000	1.1.2.35
--- tree-scalar-evolution.c	21 Apr 2004 07:50:58 -0000
*************** instantiate_parameters (struct loop *loo
*** 2878,2888 ****
  	break;
  
        case NOP_EXPR:
! 	/* res = build1 (NOP_EXPR, TREE_TYPE (chrec), 
! 	   instantiate_parameters (loop_nb, 
! 	   TREE_OPERAND (chrec, 0)));
! 	*/
! 	res = instantiate_parameters (loop, TREE_OPERAND (chrec, 0));
  	break;
  	
        default:
--- 2878,2885 ----
  	break;
  
        case NOP_EXPR:
! 	op0 = instantiate_parameters (loop, TREE_OPERAND (chrec, 0));
! 	res = chrec_convert (TREE_TYPE (chrec), op0);
  	break;
  	
        default:
Index: tree-ssa-loop-manip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-loop-manip.c,v
retrieving revision 1.1.2.13
diff -c -3 -p -r1.1.2.13 tree-ssa-loop-manip.c
*** tree-ssa-loop-manip.c	15 Apr 2004 12:59:17 -0000	1.1.2.13
--- tree-ssa-loop-manip.c	21 Apr 2004 07:50:58 -0000
*************** static void
*** 712,718 ****
--- 712,732 ----
  add_exit_phis_edge (basic_block exit, tree use)
  {
    tree phi, def_stmt = SSA_NAME_DEF_STMT (use);
+   basic_block def_bb = bb_for_stmt (def_stmt);
+   struct loop *def_loop;
    edge e;
+ 
+   /* Check that some of the edges entering the EXIT block exits a loop in
+      that USE is defined.  */
+   for (e = exit->pred; e; e = e->pred_next)
+     {
+       def_loop = find_common_loop (def_bb->loop_father, e->src->loop_father);
+       if (!flow_bb_inside_loop_p (def_loop, e->dest))
+ 	break;
+     }
+ 
+   if (!e)
+     return;
  
    phi = create_phi_node (use, exit);
  
Index: tree-ssa-loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-loop.c,v
retrieving revision 1.1.2.3.2.18
diff -c -3 -p -r1.1.2.3.2.18 tree-ssa-loop.c
*** tree-ssa-loop.c	15 Apr 2004 01:09:48 -0000	1.1.2.3.2.18
--- tree-ssa-loop.c	21 Apr 2004 07:50:58 -0000
*************** tree_ssa_loop_opt (void)
*** 83,91 ****
  
    if (loops)
      {
-       /* Ensure there is a place to move the computations to.  */
-       create_preheaders (loops, CP_SIMPLE_PREHEADERS);
- 
  #if 0
        /* Test unrolling and peeling.  */
        test_unrolling_and_peeling (loops);
--- 83,88 ----


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