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]

Re: strength reduction example


> 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.


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