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]
Other format: [Raw text]

Re: Fusing two loops


Hi,

> I am trying to fuse two loops in tree level. For that, I am trying to
> transfer statements in the header of one loop to the header of the
> other one.
> The  code   " http://rafb.net/p/fha0IG57.html "  contains the 2 loops.
> After moving a statement from one BB to another BB, do I need to
> update any other info?

you will need to update SSA form; other than that, just using bsi_move_after
to move the relevant statements should work.

>  I need to transfer all the statements of bb_6 to bb_3. Can any one
> please tell me what is the exact procedure.
> Can i simply use add_bb_to_loop() and add bb_6 to loop_1 ?

No; in the case that you describe, moving the statements one by one is
probably the simplest way (you could also move whole basic block, but
it is more complicated, and since you still need to update SSA form,
you would need to process the statements anyway).

Zdenek


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