# grep "PHI <0B([0-9]*), 0B([0-9]*)>" *.i.t50* bb-reorder.i.t50.tailc: # best_edge.1682_439 = PHI <0B(64), 0B(85)>; cfgrtl.i.t50.tailc: # x_36 = PHI <0B(4), 0B(8)>; expmed.i.t50.tailc: # tem_214 = PHI <0B(84), 0B(85)>; optabs.i.t50.tailc: # temp_393 = PHI <0B(30), 0B(29)>; optabs.i.t50.tailc: # temp_106 = PHI <0B(92), 0B(91)>; recog.i.t50.tailc: # eh_edge_50 = PHI <0B(34), 0B(31)>; recog.i.t50.tailc: # out_set_5 = PHI <0B(6), 0B(8)>; tree-ssa-ccp.i.t50.tailc: # uses_4 = PHI <0B(5), 0B(6)>; tree-ssa-forwprop.i.t50.tailc: # df_786 = PHI <0B(8), 0B(9)>; I have yet to find a small testcase for the above. It may be just a matter of running redphi one more time.
Confirmed, this seems very important as we are missing a lot of constant propagation.
kill_redundant_phi_nodes does not handle these cases since the variables are pointers, and copy propagating constants for pointers requires folding the statements and rewriting the ssa form afterwards, which I originally wanted to avoid. Now that we from some reason need to rewrite the ssa form anyway, it should be fairly easy to implement. I however do not know why dom+dce fail to eliminate this.
Patch: http://gcc.gnu.org/ml/gcc-patches/2004-06/msg01402.html
Subject: Bug 15991 CVSROOT: /cvs/gcc Module name: gcc Changes by: rakdver@gcc.gnu.org 2004-06-17 17:47:47 Modified files: gcc : ChangeLog tree-cfg.c tree-flow-inline.h tree-flow.h tree-ssa.c tree-ssanames.c tree.h Log message: PR tree-optimization/15991 * tree-cfg.c (tree_block_label): Export. * tree-flow-inline.h (bsi_after_labels): New function. * tree-flow.h (bsi_after_labels, tree_block_label): Declare. * tree-ssa.c (propagate_into_addr): New function. (replace_immediate_uses): Handle propagation of pointer constants. (raise_value): Do not restrict propagation of pointer constants. * tree-ssanames.c (duplicate_ssa_name): New function. * tree.h (duplicate_ssa_name): Declare. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4016&r2=2.4017 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-cfg.c.diff?cvsroot=gcc&r1=2.12&r2=2.13 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-flow-inline.h.diff?cvsroot=gcc&r1=2.8&r2=2.9 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-flow.h.diff?cvsroot=gcc&r1=2.8&r2=2.9 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa.c.diff?cvsroot=gcc&r1=2.9&r2=2.10 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssanames.c.diff?cvsroot=gcc&r1=2.2&r2=2.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.519&r2=1.520
Fixed.
Subject: Re: phi nodes with identical arguments still remain at t50.tailc On Thu, 2004-06-17 at 13:47, cvs-commit at gcc dot gnu dot org wrote: > PR tree-optimization/15991 > * tree-cfg.c (tree_block_label): Export. > * tree-flow-inline.h (bsi_after_labels): New function. > * tree-flow.h (bsi_after_labels, tree_block_label): Declare. > * tree-ssa.c (propagate_into_addr): New function. > (replace_immediate_uses): Handle propagation of pointer constants. > (raise_value): Do not restrict propagation of pointer constants. > * tree-ssanames.c (duplicate_ssa_name): New function. > * tree.h (duplicate_ssa_name): Declare. > Did you also add a test case? Or was there one present already? Thanks. Diego.