[LLVMdev] How to get block with a backedge
Sebastian Dreßler
dressler at zib.de
Wed Feb 20 04:20:20 PST 2013
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
dressler at zib.de
Phone: +49 30 84185-261
http://www.zib.de/
More information about the llvm-dev
mailing list