o
    ØÝ2gì  ã                   @  s2   d Z ddlmZ ddlmZmZmZ ddd	„Zd
S )a%  Find basic blocks that are likely to be executed frequently.

For example, this would not include blocks that have exception handlers.

We can use different optimization heuristics for common and rare code. For
example, we can make IR fast to compile instead of fast to execute for rare
code.
é    )Úannotations)Ú
BasicBlockÚBranchÚGotoÚentry_pointr   Úreturnúset[BasicBlock]c                 C  s’   t ƒ }| g}|rG| ¡ }||v rq| |¡ |j}t|tƒr%| |j¡ n t|tƒrE|j	s2|j
d ur9| |j¡ n| |j¡ | |j¡ |s|S )N)ÚsetÚpopÚaddÚ
terminatorÚ
isinstancer   ÚappendÚlabelr   ÚrareÚtraceback_entryÚfalseÚtrue)r   ÚresultÚworklistÚblockÚt© r   úP/home/garg/my-data/venv/lib/python3.10/site-packages/mypyc/analysis/blockfreq.pyÚfrequently_executed_blocks   s"   


ór   N)r   r   r   r   )Ú__doc__Ú
__future__r   Úmypyc.ir.opsr   r   r   r   r   r   r   r   Ú<module>   s    	