[PATCH] condition branch simplification
commit015f2c6d1c7439ff5e03ef119d8f7da167bfd3e4
authorChristopher Li <sparse@chrisli.org>
Wed, 14 Apr 2004 23:18:13 +0000 (14 16:18 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 8 Apr 2005 04:01:32 +0000 (7 21:01 -0700)
tree558f93d8a81c3413bbbc83a38735bce2e52eb3fc
parente79ea0da8b23c7ad2c9bb9e24ec72a7802fc630b
[PATCH] condition branch simplification

Here is the updated version of the patch.

I tried to do as well on the iterator flattening as the old code, but
then realized that the end result will be about as complex as what was
there from before.  So instead I wrote a simple pass to stitch the basic
blocks together.  It does two things: ff it is an empty block with a
goto, it transfers the outgoing edge directly to the target.  And if the
only parent ends with a goto, it combines the block with the parent.

There is also dead code elimination.  So I removed the previous entry
point hack for while loops.  There is no need for that any more, and the
end result is that we generate very compact basic blocks, often better
than the previous approach did.

The extra pass can almost certainly be reused for other back end passes.

I also did:
 - add some lib functions to delete a point from the ptr_list while
   iterating.
 - Ignore labels which are not used
 - some minor bug fixing to the previous patch

Know problem:
 - it doesn't deal with phi correctly, I need to redo the phi base
   on Tommy's suggestion.
lib.c
lib.h
linearize.c
linearize.h
symbol.h