This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Cleanup for linear transform: use standard_iv_increment_position
Sebastian Pop wrote:
> Richard Henderson wrote:
> > > * tree-ssa-loop-manip.c (standard_iv_increment_position): Ensure
> > > that the statement is not inserted after a condition expression:
> > > i.e. the inserted code should not be the last statement in a
> > > basic block.
> >
> > This part is surely unrelated?
>
You're right,
after having bootstrapped the following patch I see that there is no
need to change standard_iv_increment_position in mainline. I should
investigate why I need this change on autovect branch.
*** tree-ssa-loop-ivopts.c.~2.47.~ 2005-02-14 14:23:35.000000000 +0100
--- tree-ssa-loop-ivopts.c 2005-02-14 14:52:05.205304752 +0100
***************
*** 5328,5333 ****
--- 5328,5345 ----
return changed;
}
+ static void
+ insert_foo_iv_in (struct loop *loop)
+ {
+ block_stmt_iterator bsi;
+ bool insert_after;
+
+ fprintf (stdout, "Insert IV\n");
+ standard_iv_increment_position (loop, &bsi, &insert_after);
+ create_iv (integer_zero_node, integer_one_node, NULL_TREE, loop, &bsi,
+ insert_after, NULL, NULL);
+ }
+
/* Main entry point. Optimizes induction variables in LOOPS. */
void
***************
*** 5356,5361 ****
--- 5368,5376 ----
tree_ssa_iv_optimize_loop (&data, loop);
+ insert_foo_iv_in (loop);
+ verify_flow_info ();
+
if (loop->next)
{
loop = loop->next;