This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] Tail recursion improvement
- From: law at redhat dot com
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, jh at suse dot cz, rth at redhat dot com
- Date: Tue, 02 Mar 2004 21:18:36 -0700
- Subject: Re: [tree-ssa] Tail recursion improvement
- Reply-to: law at redhat dot com
In message <20040225075130.GA20753@atrey.karlin.mff.cuni.cz>, Zdenek Dvorak wri
>> You don't actually use the result of propagate_through_phis to do any
>> kind of expression replacement do you (such as we recently found in
>> tree-ssa-pre.c). If so, then we'll need some adjustments to ensure
>> that the annotations are kept up-to-date.
>Not here, but the result of independent_on_stmt_p is used. What needs
>to be done?
If you replace an SSA_NAME in an expression with a different SSA_NAME,
then you need to make sure the annotations are updated (such as type_mem_tag).
the type_mem_tag in the annotation
replace_exp will handle all this for you.
For this particular code it appears that you are generating a totally new
expression using the result of independent_on_stmt_p and I'm pretty sure
you're safe in this case.
As discussed, the tree-optimize.c change is wrong. I did a new test cycle
without the tree-optimize.c change.
>+ To do this, we maintain two accumulators (a_acc and m_acc) that say us
>+ when we reach the return x statement, we should return a_acc + x * m_acc
I replaced "that say us that" "that indicate"
>! /* Checks whether the expression EXPR in stmt AT is independent on the
>! statement pointed by BSI (in a sense that we already know its value
>! there). We use the fact that we are only called from the chain of
>! basic blocks that have only single successor. Returns the expression
>! containing the value of EXPR at BSI. */
I reworded this comment slightly to avoid ambiguous pronouns. I also
renamed the function to be "independent_of_stmt_p", which I think is more
correct. The comment now looks like:
/* Checks whether the expression EXPR in stmt AT is independent of the
statement pointed by BSI (in a sense that we already know EXPR's value
at BSI). We use the fact that we are only called from the chain of
basic blocks that have only single successor. Returns the expression
containing the value of EXPR at BSI. */
I'm going to go ahead and check in your patch momentarily (without the
tree-optimize.c change). I did a bootstrap and check cycle on