This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Moving statements from one BB to other BB.
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: Sandeep Maram <sandeep244 at gmail dot com>, gcc at gcc dot gnu dot org, Diego Novillo <dnovillo at google dot com>
- Date: Tue, 15 Apr 2008 14:05:38 +0200
- Subject: Re: Moving statements from one BB to other BB.
- References: <4aca3dc20804142204n2a5a8499u5bf33c98862b4ae@mail.gmail.com>
Hi,
> To clarify what Richard means, your assertion that "you have updated
> SSA information" is false.
> If you had updated the SSA information, the error would not occur :).
>
> How exactly are you updating the ssa information?
>
> The general way to update SSA for this case would be:
>
> For each statement you have moved:
> Call update_stmt (t);
>
> Then call update_ssa (TODO_update_ssa) (or instead use
> rewrite_into_loop_closed_ssa if this is a loop pass).
>
> If you do not call update_stmt in this case, update_ssa won't actually
> do anything.
actually, it will not do anything even if he calls update_stmt, as the
statements that he is moving are already in ssa form, so update_stmt
will not mark anything for renaming.
IIRC what he tries to do is loop fusion, and according to the error message
that he gets, he probably needs to add the calculations of the induction
variable(s) of the original loop to the new one, and replace their uses
(or maybe just move phi nodes),
Zdenek