This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: strength reduction example
- To: wilson at cygnus dot com (Jim Wilson)
- Subject: Re: strength reduction example
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Fri, 19 Feb 1999 22:27:44 +0000 (GMT)
- Cc: amylaar at cygnus dot co dot uk, zack at rabi dot columbia dot edu, law at cygnus dot com, egcs at egcs dot cygnus dot com
> What does this patch do? There are no comments explaining what it does,
> and you didn't offer any explanation. All I know is that it gives better
> code for Zack's testcase, but I am not going to approve it unless I can
> understand why.
When I implemented the biv increment -> giv conversion, I made DEST_REG givs.
the giv combination is not really good at handling cases when there are
DEST_REG givs that are only used for a DEST_ADDR giv that could be changed
to make the DEST_REG giv dead.
> Actually, I see one clue in the changelog entry, it mentions creating
> address givs, but nowhere do I see DEST_ADDR used in your patch.
The address givs are not created explicitly, but by combining the register
set into its use, I create DEST_ADDR givs if the use happens to be in
a MEM. If we can combine the set into some other uses, so much the better.
> Why do you want to call subst? subst is a combiner internal routine.
> I'm skeptical that making it callable from elsewhere is a good idea.
> That could just result in a lot of bugs and maintenance problems.
> You will have to have a good reason for wanting to do this before I will
> seriously consider it.
I have found out in the meantime that calling subst from outside is
indeed not a good idea. Look at my follow-up-patch, which defines
a function validate_subst in combine to handle the combiner internals.
In effect, I want to combine the setting of an register with its use -
possibly with multiple uses - outside of combine. Re-using code from
combine seemed the natural thing to do.