This is the mail archive of the gcc@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]

[tree-ssa] How to increase PHI capacity?


Hi,

I'm trying to kill jumps to jumps.  We seem to create lots of them and
it should be not too difficult to get rid of them at the tree level.  

I was playing with some ideas and I bumped into this problem with PHI
node capacity.  Consider these three basic blocks: bb ends with a jump
to old_dest which is nothing else but another jump to new_dest:

(gdb) call debug_tree_bb (bb)
BLOCK       22
PRED:       21 (false)
SUCC:       220
PARENT:     21
LOOP DEPTH: 0
NEXT BLOCK: 23
PREV BLOCK: 21
542  goto yyabortlab;
(gdb) call debug_tree_bb (old_dest)
BLOCK       220
PRED:       195 189 22
SUCC:       222
PARENT:     nil
LOOP DEPTH: 0
NEXT BLOCK: 221
PREV BLOCK: 219
# yyss_12 = PHI <yyss_375(22), yyss_11(189), yyss_11(195)>;
-1  yyabortlab:;
918  goto yyreturn;
(gdb) call debug_tree_bb (new_dest)
BLOCK       222
PRED:       221 220 219
SUCC:       226 (exec) 223 (false)
PARENT:     nil
LOOP DEPTH: 0
NEXT BLOCK: 223
PREV BLOCK: 221
# yyss_13 = PHI <yyss_10(221), yyss_11(219), yyss_12(220)>;
# yyresult_256 = PHI <2(221), 0(219), 1(220)>;
-1  yyreturn:;
930  if (yyss_13 != &yyssa)

Obviously, the jump from 22 to 220 can be forwared to 222  (<grin> I did
not make up all those 2's :-).  To do so, the PHI arg "yyss_275(22)" in
block 220 (old_dest) has to be forwarded to 222 (new_dest), and the PHI
arg 1(220) has to be duplicated for the edge from 22 to 222.  But the
PHI_CAPACITY of the PHIs is only 3; there's no room for a fourth
argument...  Gives me an abort in add_phi_arg(), of course.

There doesn't seem to be an easy way to increase the capacity of a PHI,
at least I can't find it.  Is this just missing, or have my thoughts
completely misguided me here?

Gr.
Steven


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