Patch to improve jump_optimize_1

John Wehle john@feith.com
Sun Apr 8 21:08:00 GMT 2001


>On Sun, Apr 08, 2001 at 11:48:46AM -0400, John Wehle wrote:
>> 	* jump.c (jump_optimize_1): When deleting unused sets
>> 	handle cond_exec, constant calls have no side effects,
>> 	and use delete_computation.
>
>(1) cond_exec is not generated before reload, which is the
>     only time this code is run.

True.  I missed that.

> (2) const calls should have their entire surrounding libcall
>     removed, which your code does not even look at.

Assuming the REG_LIBCALL and REG_RETVAL notes are around (which
they are before reload).  I was missed the fact that this part
of jump_optimize_1 is only run before reload.

> (3) all of this should be handled by life_analysis.  Why isn't it?

Why does this piece of code still exist in jump_optimize_1?  I believe
that some of the other optimizers use jump_optimize to clean up after
them (gcse comes to mind).  The idea is to try to remove useless code
when possible to keep things simple for the various optimizers if it's
not too much work.

This piece of code does seem a little redundant given the existence of
delete_trivially_dead_insns.  Possibly the whole for loop should just
be replaced with a call to delete_trivially_dead_insns which also
addresses the libcall issue.  What do you think?

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



More information about the Gcc-patches mailing list