[dataflow]: Allow web to be moved past scheduling by adding libcall ids

Daniel Berlin dberlin@dberlin.org
Mon Feb 6 14:25:00 GMT 2006


On dataflow branch, if you move web (or any pass that calls cleanup_cfg)
past the fist scheduling pass, any machine that runs the first
scheduling pass (like ppc) will fail to work properly.

This is because scheduling will move pieces of non-REG_NO_CONFLICT
libcall blocks around, and the scanning in dce.c will now fail to find
the beginning and end pieces. 

Other places in our compiler will happily mark the rest of the program
in one direction or the other as a libcall block in this situation
(instead of asserting that it finds the other end of it), which I
decided this was the wrong answer (the main reason being that they
aren't part of a libcall).

After speaking with Ian Taylor about what to do here, I implemented the
following:

I added a reg note which tells you which instructions are part of which
libcall notes.

This enables DCE (and any other pass that scans libcalls) to precisely
mark the rest of the instructions that are part of a libcall it has
marked a portion of, instead of either

	a. Scanning in both directions for each libcall.
	b. Accidently marking the rest of the program when scheduling has
hoisted some part of our libcall.


One could argue that scheduling shouldn't move pieces of libcalls
independently (and indeed, for no-conflict blocks, it won't), since it
doesn't matter in the end, but ISTM that we should just let it move
whatever it wants, and still DTRT.  Special casing more libcalls in more
places seems to be the opposite of what we want to do (which is remove
as much of libcalls as possible).

In addition, this note makes it easier to not have to maintain global
state variables in order to determine whether you are in a libcall block
or not.

If the current instruction is part of a libcall, it will have the
REG_LIBCALL_ID note attached.  No more trying to determine the bounds,
seeing if you are inside them, setting a static variable, and then
resetting it when you are done.

Bootstrapped and regtested on dataflow branch on ppc-gnu-linux with web
moved past scheduling.

Committed to dataflow-branch



-------------- next part --------------
A non-text attachment was scrubbed...
Name: libcallid.diff
Type: text/x-patch
Size: 7684 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060206/dc4e7e96/attachment.bin>


More information about the Gcc-patches mailing list