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]

Re: [patch] tree-phinodes.c: Make make_phi_node static.





> Attached is a patch to make make_phi_node static as it is called only
> from tree-phinodes.c.
>

I actually added a call to make_phi_node in my patch to tree-vectorizer.c -
http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00283.html. We're creating new
phis (in a new basic block) that correspond to phis in another basic block
and we want these phis to be in the same order because in some cases we
need to redefine the arguments of the new phis (this happens soon after
they are created). The code to do that becomes very compact and efficient
if we know that the phis are arranged this way. create_phi_node however
adds new phis in a reversed order, so I added an internal version of
create_phi_node in the vectorizer ("slpeel_create_phi_node") that adds the
phis in a "straight" order (and calls make_phi_node to do that). I'd have
to move this function to tree-phinodes.c if make_phi_node was made static.
I don't know if that's desirable?

dorit



                                                                                                                                 
                      Kazu Hirata                                                                                                
                      <kazu@cs.umass.edu        To:       gcc-patches@gcc.gnu.org                                                
                      >                         cc:                                                                              
                      Sent by:                  Subject:  [patch] tree-phinodes.c: Make make_phi_node static.                    
                      gcc-patches-owner@                                                                                         
                      gcc.gnu.org                                                                                                
                                                                                                                                 
                                                                                                                                 
                      04/11/2004 19:44                                                                                           
                                                                                                                                 




Hi,

Attached is a patch to make make_phi_node static as it is called only
from tree-phinodes.c.

I don't think it is a good idea to expose this low-level function as
an extern function.  Currently, a PHI node chain is maintained in
tree-phinodes.c.  We don't want other modules to modify a PHI node
chain.

Bootstrapped on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2004-11-04  Kazu Hirata  <kazu@cs.umass.edu>

             * tree-phinodes.c (make_phi_node): Make it static.
             * tree.h: Remove the prototypes for make_phi_node.

Index: tree-phinodes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-phinodes.c,v
retrieving revision 2.17
diff -u -d -p -r2.17 tree-phinodes.c
--- tree-phinodes.c            2 Nov 2004 13:23:05 -0000           2.17
+++ tree-phinodes.c            3 Nov 2004 05:55:58 -0000
@@ -202,7 +202,7 @@ ideal_phi_node_len (int len)
    definitions created when a variable is used without a preceding
    definition).  */

-tree
+static tree
 make_phi_node (tree var, int len)
 {
   tree phi;
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.643
diff -u -d -p -r1.643 tree.h
--- tree.h         29 Oct 2004 14:05:43 -0000          1.643
+++ tree.h         3 Nov 2004 05:56:01 -0000
@@ -2768,7 +2768,6 @@ extern tree make_tree_vec_stat (int MEM_

 /* Tree nodes for SSA analysis.  */

-extern tree make_phi_node (tree, int);
 extern void init_phinodes (void);
 extern void fini_phinodes (void);
 extern void release_phi_node (tree);



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