This is the mail archive of the
mailing list for the GCC project.
Re: [patch] tree-phinodes.c: Make make_phi_node static.
> 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?
I understand your concern. I would prefer either
1) using the combination of create_phi_node and nreverse, or
2) moving your slpeel_create_phi_node to tree-phinodes.c.
In any case, code to manipulate PHI node chain doesn't seem to belong
to the vectorizer.
I was actually thinking about addressing this issue. The main
difficulty is that people want to copy a chain of PHI nodes while
doing different things.