How to get block with a backedge

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get block with a backedge

Blind Faith
I can get the loop header block by using 

getAnalysis < LoopInfo > ( *F ).isLoopHeader( BB )

But is there any way with with you can also check the blocks containing backedge.



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How to get block with a backedge

Sebastian Dreßler
Hi,

On 02/20/2013 12:42 PM, Blind Faith wrote:
> I can get the loop header block by using
>
> getAnalysis < LoopInfo > ( *F ).isLoopHeader( BB )
>
> But is there any way with with you can also check the blocks containing
> backedge.
>

Usually, the loop header is the BB with the backedge. You can get the
number of backedges by using "getNumBackEdges()" of the LoopInfo pass.

You can also use the DominatorTree directly to search for backedges.


Cheers,
Sebastian

--
Mit freundlichen Grüßen / Kind regards

Sebastian Dreßler

Zuse Institute Berlin (ZIB)
Takustraße 7
D-14195 Berlin-Dahlem
Germany

[hidden email]
Phone: +49 30 84185-261

http://www.zib.de/
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev