
    0;jif|                     *   d Z ddlmZmZ ddlZddlZddlmZmZ ddl	m
Z
mZmZ ddlmZmZ ddlmZmZ  ej        e          Zd Zd	 Z ed
d          Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d Z#d Z$d Z%d Z&de'fdZ(dddZ)dS ) z&
Implement transformation on Numba IR
    )
namedtupledefaultdictN)compute_cfg_from_blocksfind_top_level_loops)errorsirir_utils)compute_use_defsr   )	PYVERSION_lazy_pformatc                      fd}d }fd}t                               d           g }t                     D ]}t                               d|            ||          ra ||          rV ||          rK                                 |j        vr0|                    |           t                               d|           |S )zE
    Returns a list of loops that are candidate for loop lifting
    c                 6   t                      }| j        D ]R}t          d                     |          D                       }|st                              d            dS ||z  }St          |          dk    }t                              d||           |S )z)all exits must point to the same locationc              3       K   | ]	\  }}|V  
d S N ).0x_s      O/root/voice-cloning/.venv/lib/python3.11/site-packages/numba/core/transforms.py	<genexpr>zL_extract_loop_lifting_candidates.<locals>.same_exit_point.<locals>.<genexpr>   s&      88da888888    zreturn-statement in loop.F   zsame_exit_point=%s (%s))setexits
successors_loggerdebuglen)loopoutedgesksuccsokcfgs        r   same_exit_pointz9_extract_loop_lifting_candidates.<locals>.same_exit_point   s    55 	 	A88cnnQ&7&788888E  9:::uuHH]]a/X>>>	r   c                 l    t          | j                  dk    }t                              d|           |S )zthere is one entryr   zone_entry=%s)r   entriesr   r   )r   r#   s     r   	one_entryz3_extract_loop_lifting_candidates.<locals>.one_entry(   s/    !#nb)))	r   c                    t          | j                  t          | j                  z  t          | j                  z  }t	          j        |          D ]c}|j        D ]Y}t          |t          j                  r=t          |j	        t          j
                  rt                              d             dS Zdt                              d           dS )z!cannot have yield inside the loopz	has yieldFzno yieldT)r   bodyr'   r   map__getitem__
isinstancer   AssignvalueYieldr   r   )r   insidersblkinstblockss       r   cannot_yieldz6_extract_loop_lifting_candidates.<locals>.cannot_yield.   s    ty>>C$5$55DJGv)844 	% 	%C % %dBI.. %!$*bh77 %k222$uuu	%
 	j!!!tr   zfinding looplift candidatesztop-level loop: %szadd candidate: %s)r   infor   r   entry_pointr'   append)r$   r4   r%   r(   r5   
candidatesr   s   ``     r    _extract_loop_lifting_candidatesr:      s   
       
 
 
 
 
 LL./// J$S)) 5 5*D111OD!! 	5iioo 	5,,t:L:L 	5OOT\11d###MM-t444r   c                    ||         }||         }i }|D ]}| |         ||<   t                      }	t                      }
t          |          }|j                                        D ]}|	|z  }	|j                                        D ]}|
|z  }
|	|
z  }t          t          |          |z            }t          t          |          |z  |
z            }||fS )z7Find input and output variables to a block region.
    )r   r
   usemapvaluesdefmapsorted)r4   livemapcallfromreturntobody_block_idsinputsoutputs
loopblocksr!   	used_varsdef_varsdefsvsused_or_defineds                 r   find_region_inout_varsrL   H   s     XFhG
 J " "q	
1IuuHJ''Dk  ""  R		k  ""  B(*O CKK/122FS\\O3h>??G7?r   loop_lift_infoz%loop,inputs,outputs,callfrom,returntoc                    t          | |          }g }|D ]}|j        \  }t          t          |j                            }t          |j                  dk    r|                     |          \  \  }}	n|}t          |j                  t          |j                  z  t          |j                  z  }
t          |||||
          \  }}t          |||||          }|                    |           |S )z8
    Returns information on looplifting candidates.
    r   )r4   r@   rA   rB   rC   )r   rD   rE   rA   rB   )r:   r'   nextiterr   r   r   r   r*   rL   _loop_lift_infor8   )r$   r4   r@   loops	loopinfosr   rA   an_exitrB   r   local_block_idsrD   rE   llis                 r   _loop_lift_get_candidate_infosrW   h   s    -S&99EI  \
tDJ''((tz??Q!nnW55O]h Hdi..3t|+<+<<s4:N0*
 
 
 4'/(D D Dr   c                     |j         }|j        }t          j        ||          }t	          j        || |||           |S )zR
    Transform calling block from top-level function to call the lifted loop.
    scopeloc)newblockcallee
label_nextrD   rE   )rZ   r[   r   Blockr	   fill_block_with_call)
liftedloopblockrD   rE   rB   rZ   r[   r2   s           r   _loop_lift_modify_call_blockrc      sV     KE
)C
(C
(
(
(C!    Jr   c                 >   || j                  }|j        }|j        }t          |          dz
  }t	          j        t          j        ||          | j        | j                   ||<   t	          j	        t          j        ||          | j
                  || j        <   dS )z?
    Inplace transform loop blocks for use as lifted loop.
    r   rY   )rb   rD   r^   )rb   rE   N)rA   rZ   r[   minr	   fill_callee_prologuer   r_   rD   fill_callee_epiloguerE   rB   )loopinfor4   entry_blockrZ   r[   firstblks         r   _loop_lift_prepare_loop_funcrk      s     *+KE
/C 6{{QH4hU,,,$  F8
 !) =hU,,, ! ! !F8r   c                    ddl m} |j        }t          |j                  t          |j                  z  }	t          |j                  dk    r
|	|j        z  }	t          fd|	D                       }
t          ||
           g }|

                                D ]+}|                    |                    d                     ,t          |d           }|j        }|                     |
t!          |j                  t          |j                  d	|
          } ||||||          }t%          ||j                 |j        |j        |j                  }|	D ]}|= ||j        <   |S )zu
    Modify the block inplace to call to the lifted-loop.
    Returns a dictionary of blocks of the lifted-loop.
    r   )
LiftedLoopr   c              3   P   K   | ] }||                                          fV  !d S r   )copy)r   r!   r4   s     r   r   z+_loop_lift_modify_blocks.<locals>.<genexpr>   s6      CCq&)..**+CCCCCCr   getiter)opc                     | j         j        S r   )r[   liner   s    r   <lambda>z*_loop_lift_modify_blocks.<locals>.<lambda>   s
    QUZ r   )keyT)r4   	arg_names	arg_countforce_non_generatorr[   )numba.core.dispatcherrm   r   r   r*   r'   r   r   dictrk   r=   extend
find_exprsre   r[   derivetuplerD   rc   rA   rE   rB   )func_irrh   r4   	typingctx	targetctxflagslocalsrm   r   loopblockkeysrF   getiter_exprsr2   first_getiterloop_loc	lifted_irra   	callblockr!   s     `                r   _loop_lift_modify_blocksr      s    100000 =D	NNS%6%66M
4:#CCCC]CCCCCJ :666 M  "" ; ;S^^y^99::::+?+?@@@M Hj).x)?)?),X_)=)=37#+	  - -I
 I%y%A AJ -Z@Q9R-5_h>N-5->@ @I   1II )F8r   c                 h   t          |j                  dk    rdS t          |j                  }|                                 }t                      }t          |          }|r?|                                }|                    |           |||         |hz
  z  }||z
  }|?t          |          dk    S )zReturns True if there is more than one exit in the loop.

    NOTE: "common exits" refers to the situation where a loop exit has another
    loop exit as its successor. In that case, we do not need to alter it.
    r   F)r   r   r   post_dominatorspopadd)r$   lpinfor   pdom	processedremainnodes          r   _has_multiple_loop_exitsr      s     6<AuE  D IZZF
 #zz||ddtf$$"	  # u::>r   c                 >   ddl m} t          | j                  }|                                                                D ]*}t          ||          rt          | |j                  \  } }+| 	                                  ||           
                                 | S )z(Canonicalize loops for looplifting.
    r   )PostProcessor)numba.core.postprocr   r   r4   rR   r=   r   _fix_multi_exit_blocksr   _reset_analysis_variablesrun)r   r   r$   	loop_info_common_keys        r   _pre_looplift_transformr      s     211111
!'.
1
1CYY[[''))  	#C33 	#9$ $ G[ %%'''M'   Nr   c           
         t          |           } | j                                        }t          |          }t	          ||| j        j                  }g }|r9t                              dt          |          t          | d                      |D ],}	t          | |	|||||          }
|                    |
           -|                     |          }||fS )z
    Loop lifting transformation.

    Given a interpreter `func_ir` returns a 2 tuple of
    `(toplevel_interp, [loop0_interp, loop1_interp, ....])`
    z+loop lifting this IR with %d candidates:
%sc                 *    |                                  S r   )dump_to_stringrt   s    r   ru   zloop_lifting.<locals>.<lambda>  s    AQAQASAS r   )	lazy_funcr4   )r   r4   ro   r   rW   variable_lifetimer@   r   r   r   r   r   r8   r~   )r   r   r   r   r   r4   r$   rS   rR   rh   liftedmains               r   loop_liftingr     s     &g..G^  ""F
!&
)
)C.sF/6/H/PR RIE VD)nn#G7S7STTT	V 	V 	V   )'8V*3YvO OV >>>((D;r   c                      t                                                      fd fdfd}d fd} |            D ]} ||           S )z5
    Rewrite loops that have multiple backedges.
    c                  L    t                                                     dz   S )Nr   )maxkeys)	newblockss   r   new_block_idz6canonicalize_cfg_single_backedge.<locals>.new_block_id+  s     9>>##$$q((r   c                     d}| j         D ]:}|         }|j                                        }| j        |v r|dz  }|dk    r dS ;dS )Nr   r   TF)r*   
terminatorget_targetsheader)r   countr!   r2   edgesr4   s        r   has_multiple_backedgesz@canonicalize_cfg_single_backedge.<locals>.has_multiple_backedges.  sa     	  	 A)CN..00E{e##
19944ur   c               3   |   K                                                                    D ]}  |           r| V  d S r   )rR   r=   )lpr$   r   s    r   #yield_loops_with_multiple_backedgeszMcanonicalize_cfg_single_backedge.<locals>.yield_loops_with_multiple_backedges;  sQ      ))++$$&& 	 	B%%b)) 	 	r   c                 x   fd}t          | t          j                  r>t          j        | j         || j                   || j                  | j                  S t          | t          j                  r)t          j         || j                  | j                  S | 	                                rJ | S )Nc                     | k    rn| S r   r   )targetdstsrcs    r   replacezIcanonicalize_cfg_single_backedge.<locals>.replace_target.<locals>.replaceA  s    !S==CCf5r   )condtruebrfalsebrr[   r   r[   )
r-   r   Branchr   r   r   r[   Jumpr   r   )termr   r   r   s    `` r   replace_targetz8canonicalize_cfg_single_backedge.<locals>.replace_target@  s    	6 	6 	6 	6 	6 	6 dBI&& 		9$)$+GDK$8$8%,WT\%:%:!%+ + + + bg&& 	7''$+"6"6DHEEEE'')))))Kr   c                    | j         }             }| j        D ]X}	|         }||j                                        v r3|                                } 
|j        ||          |j        d<   |	|<   Y	|         }t          j        |j        |j                  }|	                    t          j
        ||j                             |	|<   dS )zC
        Add new tail block that gathers all the backedges
        rY   r   N)r   r*   r   r   ro   r   r_   rZ   r[   r8   r   )r   r   tailkeyblkkeyr2   newblkentryblktailblkr   r   r   s           r   rewrite_single_backedgezAcanonicalize_cfg_single_backedge.<locals>.rewrite_single_backedgeO  s     ,..i 	+ 	+FF#C335555"0.18#: #:B$*	&!V$(X\BBBrwf'+>>>???$	'r   )r   ro   )	r4   r   r   r   r$   r   r   r   r   s	   `   @@@@@r    canonicalize_cfg_single_backedger   $  s     "&
)
)CI) ) ) ) )         
  % % % % % % %* 4355 & &%%%%r   c                      t          |           S )zc
    Rewrite the given blocks to canonicalize the CFG.
    Returns a new dictionary of blocks.
    )r   r   s    r   canonicalize_cfgr   j  s    
 ,F333r   c           
      ^   ddl m} dfd	}t          |           \  }} |s| g fS |                    |                                            | j        sJ | j        }| j                                        }	|j        }
g }|D ]\  }}g }t          |
||          D ]}|
                    |           t          |	|                    t          | |	|          \  }}|                    | |	|||||          }|
                    |           |s| }n|                     |	          }||fS )zWith-lifting transformation

    Rewrite the IR to extract all withs.
    Only the top-level withs are extracted.
    Returns the (the_new_ir, the_lifted_with_ir)
    r   )postprocFc                     ddl m}m}                                 }|rd|_        d|_        d|_        d|_        |}n|} || 
	|fi |S )Nr   )
LiftedWithObjModeLiftedWithFT)rz   r   r   ro   enable_loopliftenable_pyobjectforce_pyobjectno_cpython_wrapper)r   
objectmodekwargsr   r   myflagsclsr   r   r   r   s          r   dispatcher_factoryz(with_lifting.<locals>.dispatcher_factory{  s|    GGGGGGGG**,, 		&+G#&*G#%)G").G&#CCCs7Iy'6LLVLLLr   )F)
numba.corer   find_setupwithsr   r   r   r4   ro   r$   _cfg_nodes_in_regionr8   _legalize_with_head_get_with_contextmanagermutate_with_bodyr~   )r   r   r   r   r   r   r   withsvltr4   r$   sub_irs	blk_startblk_endbody_blocksr   cmkindextrasubnew_irs    ````               r   with_liftingr   r  s    $#####M M M M M M M M M" %W--NE7 {7##'')))$$$$

#C^  ""F
'C G %  G(iAA 	% 	%Dt$$$$F9-...0&)LL%%gvy'&13E&+- - 	s (''7?r   c                 Z   	 d fd	 	fd}         j         D ]h}t          |t          j                  rL|j        } ||          \  }}t          |d          s!t          j        d         j                  ||fc S it          j        d         j                  )z7Get the global object used for the context manager
    zIllegal use of context-manager.c                 .                         |           S )z#Get the definition given a variable)get_definition)varr   s    r   get_var_dfnz-_get_with_contextmanager.<locals>.get_var_dfn  s    %%c***r   c                    	                     |           }t          |t          j                  r>|j        dk    r3
fd|j        D             }
fd|j        D             }||d}|j        } nd}t          j	        t          j
        	|           }|t          j        u r!t          j        d         j                  |t          j        |j                  ||fS )zReturn the context-manager object and extra info.

        The extra contains the arguments if the context-manager is used
        as a call.
        callc                 &    g | ]} |          S r   r   )r   r   r   s     r   
<listcomp>zD_get_with_contextmanager.<locals>.get_ctxmgr_obj.<locals>.<listcomp>  s!    555qKKNN555r   c                 .    i | ]\  }}| |          S r   r   )r   r!   vr   s      r   
<dictcomp>zD_get_with_contextmanager.<locals>.get_ctxmgr_obj.<locals>.<dictcomp>  s'    999A1kk!nn999r   )argsr   Nz*Undefined variable used as context managerr[   )r   r-   r   Exprrq   r   kwsfuncr	   guardfind_outer_value	UNDEFINEDr   CompilerErrorr[   )var_refdfnr   r   r   ctxobj_illegal_cm_msgr   r4   r   r   s         r   get_ctxmgr_objz0_get_with_contextmanager.<locals>.get_ctxmgr_obj  s     $$W--c27## 	&(8(85555CH555D9999999C!S11EhGGE 97GLL R\!!&<9%)   
 >&CGDDDDu}r   r   z"Unsupported context manager in user   zmalformed with-context usage)	r*   r-   r   	EnterWithcontextmanagerhasattrr   r  r[   )
r   r4   r   r	  stmtr  r  r   r  r   s
   ```     @@r   r   r     s    8O+ + + + +        > y!& 	! 	!dBL)) 	!)G*N733MFE6#566 *8y)-    5=   	! 
&9!
 
 
 
r   c                    t          t                    }| j        D ]}|t          |          xx         dz  cc<    |                    t
          j                  dk    rt          j        d| j	                  |                    t
          j
        d          dk    rt          j        d| j	                  |                    t
          j        d           |rt          j        d| j	                  dS )zaGiven *blk*, the head block of the with-context, check that it doesn't
    do anything else.
    r   z0with's head-block must have exactly 1 ENTER_WITHr   r   z*with's head-block must have exactly 1 JUMPNz'illegal statements in with's head-block)r   intr*   typer   r   r
  r   r  r[   r   Del)r2   countersr  s      r   r   r     s    3H " "d!||BL!!Q&&">   	 ||BGQ1$$"8   	
 LL "5   	 r   c                 (  	 t                      	|g}|r||                                }t          |                     |                    }|rBt	          | \  }}t          	fd|D                       }|                    |           	|z  	||	S )z;Find the set of CFG nodes that are in the given region
    c                 (    g | ]}|vr|k    |S r   r   )r   r   
region_endregion_nodess     r   r   z(_cfg_nodes_in_region.<locals>.<listcomp>  s8     , , ,$|33
** ***r   )r   r   listr   zipr|   )
r$   region_beginr  stacktossucclistr"   r   nodesr  s
     `      @r   r   r     s     55LNE
 
"iikks++,, 	"H~HE1 , , , , ,% , , , - -E LLE!L  
" r   c                 ,    d } j         } ||          }t          ||            d |                                D             }|D ]K\  }}||         j                                        }t          |          dk    rt          j        d          L|D ]^\  }}||         }t          j	         j         |j                                        d                  j                  rt           |           _ fd|D             }t          |          }| fS )zQFind all top-level with.

    Returns a list of ranges for the with-regions.
    c                    t          |           }t                      t                      }}|                                 D ]a\  }}|j        D ]T}t	          j        |          r|                    |           t	          j        |          r|                    |           Ubt          t                    }|	                    |d          D ]}g g }
}	|	
                    |           |	r|	                                }|

                    |           | |         j        D ]}t	          j        |          rt          j        d          t	          j        |          r6||v r2||                             |           |                    |            nEt	          j        |          r0|                                D ]}||
vr|	
                    |           |	|S )NT)reversezBunsupported control flow due to raise statements inside with block)r   r   itemsr*   r	   is_setup_withr   is_pop_blockr   	topo_sortr8   r   is_raiser   r  removeis_terminatorr   )r4   r$   
sus_setupssus_popslabelrb   r  setup_with_to_pop_blocks_mapsetup_blockto_visitseents               r   find_rangesz$find_setupwiths.<locals>.find_ranges  s   %f--"uuceeH
 #LLNN 	( 	(LE5
 ( ()$// *NN5)))(.. (LL'''	( (33'7'7$==T=BB 	3 	3KdHOOK((( 3 E""""5M. 3 3D(.. ""("6!?#" #" "
  ,T22 u7H7H4[AEEeLLL ...  -d33 3!%!1!1!3!3 3 3A }} ( 2 2 25  38 ,+r   c                 B    g | ]\  }}|t          |          d          fS r   )r  )r   sps      r   r   z#find_setupwiths.<locals>.<listcomp>V  s:     5 5 5!Q T!WWQZ 5 5 5r   r   zlunsupported control flow: with-context contains branches (i.e. break/return/raise) that can leave the block r   c                 n    g | ]1\  }}|j         |         j                                        d          f2S r2  )r4   r   r   )r   r3  r4  r   s      r   r   z#find_setupwiths.<locals>.<listcomp>j  sM     : : :#a W^A.9EEGGJK : : :r   )r4   consolidate_multi_exit_withsr!  r   r   r   r   r  r	   	is_return_rewrite_return_eliminate_nested_withs)	r   r0  r4   with_ranges_dictwith_ranges_tupler   r4  targetstarget_blocks	   `        r   r   r     sy   
0, 0, 0,d ^F #{6** ++;VWMMG5 5+11335 5 5 $  A)&2244w<<1&F    $ ( (Aaygn'3355a8::DF F 	(GQ''': : : :'8: : : 00ABBg%%r   c                 8   | j         |         }|j                                        d         }| j         |         }t          j        | j                   }|dz   }|j        }t          j        d|          }t          j        ||          }	g g }}
g |	                    t          j
                  }t          |          dk    sJ t          g |	                    t          j                            dk    sJ t          |j        d         t          j                  sJ |d         }|j                            |          }|
                    |j        d|                    |
                    t          j        ||j                             |                    |j        |d                    |                    t          j        ||j                             | j         |         j        }|	j                            |           |j                                         |j                            |           |j                                         |j                            |
           |	| j         |<   t          j        | j                   | _        | S )u:  Rewrite a return block inside a with statement.

    Arguments
    ---------

    func_ir: Function IR
      the CFG to transform
    target_block_label: int
      the block index/label of the block containing the POP_BLOCK statement


    This implements a CFG transformation to insert a block between two other
    blocks.

    The input situation is:

    ┌───────────────┐
    │   top         │
    │   POP_BLOCK   │
    │   bottom      │
    └───────┬───────┘
            │
    ┌───────▼───────┐
    │               │
    │    RETURN     │
    │               │
    └───────────────┘

    If such a pattern is detected in IR, it means there is a `return` statement
    within a `with` context. The basic idea is to rewrite the CFG as follows:

    ┌───────────────┐
    │   top         │
    │   POP_BLOCK   │
    │               │
    └───────┬───────┘
            │
    ┌───────▼───────┐
    │               │
    │     bottom    │
    │               │
    └───────┬───────┘
            │
    ┌───────▼───────┐
    │               │
    │    RETURN     │
    │               │
    └───────────────┘

    We split the block that contains the `POP_BLOCK` statement into two blocks.
    Everything from the beginning of the block up to and including the
    `POP_BLOCK` statement is considered the 'top' and everything below is
    considered 'bottom'. Finally the jump statements are re-wired to make sure
    the CFG remains valid.

    r   r   Nr   r   )r4   r   r   r	   find_max_labelr[   r   Scoper_   
find_instsPopBlockr   r   r-   r*   indexr|   r8   clearbuild_definitions_definitions)r   target_block_labelr=  target_block_successor_labeltarget_block_successor	max_label	new_labelnew_block_locnew_block_scope	new_blocktop_bodybottom_body
pop_blocks	pb_markerpb_isreturn_bodys                   r   r8  r8  s  s\   t >"45L#/#:#F#F#H#H#K $^,HI '77IAI*.Mht777Om<<<I kH8<**2;778Jz??a2((11233q8888l'+RW555551I##I..EOOL%fuf-...OOBG8,:JKKLLL|(r2333rwy,*:;;<<< .!=>CKN+&&&%%'''&&{333X&&& !*GN9#5gnEEGNr   c                     g }d }t          |           D ])\  }} ||||          s|                    ||f           *|S )Nc                 4    |D ]\  }}| |k    r	||k     r dS dS )NTFr   )startendknown_rangesabs        r   within_known_rangez3_eliminate_nested_withs.<locals>.within_known_range  s5      	 	DAq qyyS1WWttur   )r?   r8   )with_rangesrY  r\  r3  es        r   r9  r9    si    L   {## ( (1!!!Q55 	(A'''r   r   c                     | D ]B}| |         }t          |          dk    r%t          ||t          j                  \  }}|h| |<   C|S )zGModify the FunctionIR to merge the exit blocks of with constructs.
    r   split_condition)r   r   r	   r#  )r   r4   r   r!   rJ   commons         r   r6  r6    s`         8r77Q;;4X-B  OGV xE!HNr   r`  c                   | j         }t          | j                                                   }|j        }t	          | j                   dz   }t          j        |j        t
          j                  }|}|dz  }|||<   t          j        |j        t
          j                  }	|}
|dz  }|	||
<   g }t          |          D ]\  }}||         }|(t          |j	                  D ]\  }} ||          r nnd}|j	        d|         }|j	        |d         }|
                    |           ||_	        |j        }|j	        
                    t          j        t          j        ||          |                    d|          |                     |j        rJ |j	        
                    t          j        |t
          j                             |&|j	        
                    |d         d                    |j        rJ |j	        
                    t          j        |
|                     g }|D ]}|
                    |           |dz  }|	}t
          j        }t          |          D ]W\  }}|                    d|          }|                    d	|          }|j	        
                    t          j        t          j        ||          ||                     |j	        
                    t          j        t
          j                            t(          j        |                    d          ||
          ||                     |d                                         \  }|j	        
                    t          j        ||||         |                     t          j        ||          }||||         <   Y|j	        
                    t          j        ||                     | |fS )a   Modify the FunctionIR to create a single common exit node given the
    original exit nodes.

    Parameters
    ----------
    func_ir :
        The FunctionIR. Mutated inplace.
    exit_nodes :
        The original exit nodes. A sequence of block keys.
    split_condition : callable or None
        If not None, it is a callable with the signature
        `split_condition(statement)` that determines if the `statement` is the
        splitting point (e.g. `POP_BLOCK`) in an exit node.
        If it's None, the exit node is not split.
    r   r   Nr   z$cp)r/   r   r[   r   z	$cp_checkz$cp_rhs)fnlhsrhsr[   rY   )r4   re   r=   rZ   r   r   r_   unknown_loc	enumerater*   r8   r[   r.   Constget_or_defineis_terminatedr   redefiner   binopoperatoreqgetr   r   )r   
exit_nodesra  r4   any_blkrZ   rJ  common_blockcommon_label
post_block
post_label
remainingsir!   r2   ptr  beforeafterr[   remain_blocksr   switch_block
match_expr	match_rhsjump_targets                             r   r   r     s&   h ^F'.''))**GMEGN##a'I8GMr~>>>LLNI'F<'-R^<<<JJNI#F: J*%% C C1Qi &%ch//  D"?4(( E B#2#%    gIBHQC000"00C0@@  	
 	
 	
 $$$$".AAABBBB"  Aq!1222))))RWZS999::: M  Y'''Q		L
.Cz** 0 0	6^^KS^99
NN9#N66	 	  Ihqc***   	
 	
 	
 	  Igmm{		%(8(8i $   "  		
 		
 		
 r
..00  Ij+}Q/?SIII	
 	
 	
 xe555#/}Q   RW[c:::;;;L  r   )*__doc__collectionsr   r   loggingrn  numba.core.analysisr   r   r   r   r   r	   r
   numba.core.utilsr   r   	getLogger__name__r   r:   rL   rQ   rW   rc   rk   r   r   r   r   r   r   r   r   r   r   r   r8  r9  r{   r6  r   r   r   r   <module>r     s;   
 0 / / / / / / /   M M M M M M M M + + + + + + + + + + I I I I I I I I 5 5 5 5 5 5 5 5 '
H
%
%2 2 2j  8 *-DF F  B  $  *, , ,^  .  $  8C C CL4 4 48 8 8v6
 6
 6
r  6  ([& [& [&|h h hV  "
 
 
 
 
 DH V! V! V! V! V! V! V!r   