This is the mail archive of the
mailing list for the GCC project.
Re: [patch] tree-phinodes.c: Make make_phi_node static.
- From: Dorit Naishlos <DORIT at il dot ibm dot com>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 7 Nov 2004 15:39:31 +0200
- Subject: 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?
<email@example.com To: firstname.lastname@example.org
Sent by: Subject: [patch] tree-phinodes.c: Make make_phi_node static.
Attached is a patch to make make_phi_node static as it is called only
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
Bootstrapped on i686-pc-linux-gnu. OK to apply?
2004-11-04 Kazu Hirata <email@example.com>
* tree-phinodes.c (make_phi_node): Make it static.
* tree.h: Remove the prototypes for make_phi_node.
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
make_phi_node (tree var, int len)
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);