[llvm-dev] LLVM Pass to count reachable BB

Krzysztof Parzyszek via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 11 10:00:23 PST 2019

On 1/11/2019 12:28 AM, hameeza ahmed via llvm-dev wrote:
> Hello,
> I have code containing conditions and loops. Hence some BB execution are 
> determined at run time depending on condition. Now I want to count only 
> those BB that are always executed irrespective of condition result means 
> reachable. and their execution is evident at compile time.
> How to do this?

You can find the set of all dominators of the exit block.  Would that 
give you what you want?


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

More information about the llvm-dev mailing list