+
    :in                     ~   ^ RI t ^ RIt^ RIt^ RIHtHtHt ^ RI	H
t
HtHt ^ RIHtHtHtHtHtHt ^ RIHt ^ RIHt ^ RIHtHtHtHt ^ RIHtHt ^ R	IHtH t H!t!H"t"H#t# ^ R
IH$t$H%t%H&t& ^ RI'H(t( ^{s)]! 4       t*R]*n+        R t, ! R R]]4      t- ! R R]-]4      t. ! R R]-]4      t/ ! R R]]4      t0 ! R R]-4      t1R# )    N)run_frontendFlags	StateDict)jitnjitliteral_unroll)typeserrorsirrewritesir_utilscpu)postproc)InlineClosureCallPass)TestCaseMemoryLeakMixinSerialMixinIRPreservingTestPipeline)dead_branch_prunerewrite_semantic_constants)ReconstructSSATranslateByteCodeIRProcessingDeadBranchPrune
PreserveIR)DefaultPassBuilderCompilerBasePassManager)	PYVERSIONTc                     \        V 4      p\        4       pWn        R Vn        R Vn        \        4       P                  V4       \        P                  P                  RV4       V# )Nzbefore-inference)
r   r   func_irtypemap	calltypesr   run_passr   rewrite_registryapply)funcr!   states   &  W/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/tests/test_analysis.pycompile_to_irr*      sS    4 GKEMEMEOe$##$6>N    c                   4   a  ] tR t^(t o RtRtR tR tRtV t	R# )TestBranchPruneBasez
Tests branch pruning
Fc                    . pVP                   P                  4        FB  pVP                  \        P                  R 7       Uu. uF  qDNK  	  ppVP                  V4       KD  	  V# u upi ))cls)blocksvalues
find_instsr   Branchextend)selfthe_irbranchesblk_tmps   &&    r)   find_branches!TestBranchPruneBase.find_branches/   s[    =='')C!nnn;<;1;C<OOC  *  =s   
A%c                   \        V4      pVP                  4       pV P                  '       d'   \        R4       \        R4       VP	                  4        \        V\        P                  ! R4      4      pVP                  4        \        P                  ! V4      p	V	P                  4        \        Wb4       V P                  '       d'   \        R4       \        R4       VP	                  4        \        Wb4       Tp
V P                  '       d   \        R4       VP	                  4        V P                  V4      pV P                  \        V4      \        V4      4       . p\!        V4       F  w  rW,          pVRJ d   VP#                  VP$                  4       K0  VRJ d   VP#                  VP&                  4       KS  Vf   KY  VR8X  d9   VP#                  VP&                  4       VP#                  VP$                  4       K  Q R4       h	  \)        VP*                  P-                  4        Uu. uF  qNK  	  up4      p\)        V
P*                  P-                  4        Uu. uF  qNK  	  up4      p V P                  VV\)        V4      ,
          4       TP3                  RRR/4      p\5        T3/ TB ! T4      P6                  T,          pTf   TP9                  4       pT! 4       pMTP8                  ! T!  pT! T!  pT P                  TT4       R# u upi u upi   \.         dG   p\        R	\1        T4      4       \        R
\1        T4      4       \        R\1        T4      4       ThRp?ii ; i)=zbefore inlineFbefore pruneafter pruneTNbothunreachable
new_labelsoriginal_labelsexpect_removedflagsnopythonP================================================================================)r*   copy_DEBUGprintdumpr   r   ParallelOptionsrunr   PostProcessorr   r   r;   assertEquallen	enumerateappendtruebrfalsebrsetr0   keysAssertionErrorsortedpopr   	overloadsentry_point)r5   r'   args_tyspruneargskwargsr!   beforeinline_pass	post_procafterbefore_branchesrE   idxbranchr9   rD   rC   esupplied_flagscresresexpecteds   &&&&*,                 r)   assert_prune TestBranchPruneBase.assert_prune6   s     %;;;(O/"LLN ,G,/,?,?,FI **73	"75;;;(O.!LLN',;;;- LLN,,V4_-s5z: #E*JC$)F}%%fmm4%%%fnn5&%%fnn5%%fmm4'-'q + &--*<*<*>?*>Qq*>?@U\\%6%6%89%8!%89:
	Z3~;N)NO  Gj$-?@8.~.t4>>xH<""$CvH""D)CT{Hh'+ @9
  	,z 23#VO%<="F>$:;G		s%   +
L
L/"L M)#AM$$M) N)
__name__
__module____qualname____firstlineno____doc__rJ   r;   rm   __static_attributes____classdictcell____classdict__s   @r)   r-   r-   (   s"      FU( U(r+   r-   c                      a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tRtV tR# )TestBranchPrunec                r   R  pV P                  V\        P                  ! R4      3R.R4       R pV P                  V\        P                  ! R4      3R.R4       R pV P                  V\        P                  ! R4      3R.R4       V P                  V\        P                  ! ^
4      3R.^
4       R pV P                  V\        P                  ! R4      3R.R4       V P                  V\        P                  ! ^
4      3R.^
4       R pV P                  V\        P                  ! R4      3R.R4       V P                  V\        P                  ! ^
4      3R.^
4       R	 pV P                  V\        P                  ! R4      3R.R4       V P                  V\        P                  ! ^
4      3R.^
4       R# )
c                     ^^ 8X  d   R# R#    n!	@Nro   xs   &r)   impl,TestBranchPrune.test_single_if.<locals>.impl       Av r+   noneTNc                     ^^8X  d   R# R# r}   ro   r   s   &r)   r   r      r   r+   Fc                     V f   R# R # )Nr   ro   r   s   &r)   r   r      s    y r+   c                     V ^
8X  d   R# R# 
   r   Nro   r   s   &r)   r   r      s    Bw r+   c                     V ^
8X  d   RpR# R# r   ro   )r   zs   & r)   r   r      s    Bw r+   c                     R pTpW8X  d   ^d# R # Nro   )r   r   ys   &  r)   r   r      s    AAv r+   rm   r	   NoneTypeIntegerLiteralr5   r   s   & r)   test_single_ifTestBranchPrune.test_single_if   s   	 	$!7 9D64H	 	$!7 9E7DI	 	$!7 9E7DI$!5!5b!9 ;dVRH	 	$!7 9D64H$!5!5b!9 ;dVRH	 	$!7 9D64H$!5!5b!9 ;dVRH	 	$!7 9E7DI$!5!5b!9 ;dVRHr+   c                    R  pV P                  V\        P                  ! R4      3R.R4       V P                  V\        P                  ! ^
4      3R.^
4       R# )c                     V f   R# R# )Nr   l&ls?ro   r   s   &r)   r   1TestBranchPrune.test_single_if_else.<locals>.impl   s    yr+   r   FNTr   r   s   & r)   test_single_if_else#TestBranchPrune.test_single_if_else   sO    	 	$!7 9E7DI$!5!5b!9 ;dVRHr+   c                b   R  pV P                  V\        P                  ! R4      3R.R4       V P                  V\        P                  ! ^d4      3R.^d4       R pV P                  V\        P                  ! R4      3R.R4       V P                  V\        P                  ! ^d4      3R.^d4       R# )c                     V ^d8X  d   R# R# d   r   Nro   r   s   &r)   r   6TestBranchPrune.test_single_if_const_val.<locals>.impl   s    Cx r+   r   TNc                     ^dV 8X  d   R# R# r   ro   r   s   &r)   r   r      s    ax r+   r   r   s   & r)   test_single_if_const_val(TestBranchPrune.test_single_if_const_val   s    	 	$!7 9D64H$!5!5c!: <tfcJ	
 	$!7 9D64H$!5!5c!: <tfcJr+   c                   R  pV P                  V\        P                  ! ^d4      3^,          R.^d^d4       V P                  V\        P                  ! R4      3^,          R.RR4       V P                  V\        P                  ! ^d4      \        P                  ! R4      3R.^dR4       V P                  V\        P                  ! ^d4      \        P                  ! R4      3R.^dR4       R# )c                     W8X  d   R # R# r   r   ro   )r   r   s   &&r)   r   ?TestBranchPrune.test_single_if_else_two_const_val.<locals>.impl   s    vr+   Nr   FT  )rm   r	   r   r   r   s   & r)   !test_single_if_else_two_const_val1TestBranchPrune.test_single_if_else_two_const_val   s    	 	$!5!5c!: <q @4&#	$!7 9A =w	 $!5!5c!:!&!7!:<@63	N$!5!5c!:!&!5!5d!;!=?Cfc4	Qr+   c                j   R  pV P                  V\        P                  ! R4      3RR.R4       V P                  V\        P                  ! ^
4      3RR.^
4       R pV P                  V\        P                  ! R4      3RR.R4       V P                  V\        P                  ! ^
4      3RR.^
4       R# )c                 8    R pV f   RpM^pV'       d   ^
pV# RpV# FTro   )r   x_is_none_workdeadr   s   &   r)   r   JTestBranchPrune.test_single_if_else_w_following_undetermined.<locals>.impl   s1    "Ny!% H Hr+   r   FNTc                 6    R pV f   RpM V'       d   ^
pV# RpV# r   ro   )r   r   r   s   &  r)   r   r      s/    "Ny!% H Hr+   r   r   s   & r)   ,test_single_if_else_w_following_undetermined<TestBranchPrune.test_single_if_else_w_following_undetermined   s    	 	$!7 9E4=$O$!5!5b!9 ;dD\2N	 	$!7 9E4=	  	$!5!5b!9 ;dD\2Nr+   c                    R  pV P                  V\        P                  ! R4      3RR.R4       V P                  V\        P                  ! ^
4      3RR.^
4       R# )c                 <    ^dp^pV f   ^dpM^pW!8X  d   ^
pWB3# RpWB3# )r   r   ro   )r   one_hundredr   r   r   s   &    r)   r   :TestBranchPrune.test_double_if_else_rt_const.<locals>.impl  sA    KNy!$, $$ $$r+   r   FNTr   r   s   & r)   test_double_if_else_rt_const,TestBranchPrune.test_double_if_else_rt_const  sS    	% 	$!7 9E4=$O$!5!5b!9 ;dD\2Nr+   c                    R  pV P                  V\        P                  ! ^
4      3R.^
4       V P                  V\        P                  ! ^d4      3R.^d4       R# )c                 "    ^dpW8X  d   RpV# RpV# )r   r   r   ro   )r   r   r   s   &  r)   r   CTestBranchPrune.test_double_if_else_non_literal_const.<locals>.impl%  s%    K H Hr+   Nrm   r	   r   r   s   & r)   %test_double_if_else_non_literal_const5TestBranchPrune.test_double_if_else_non_literal_const#  sQ    	 	$!5!5b!9 ;dVRH$!5!5c!: <tfcJr+   c                    R  pV P                  V\        P                  ! R4      3RR.R4       V P                  V\        P                  ! ^
4      3RR.^
4       R# )c                 0    V f   ^
pM^(pV e   ^dpW!3# RpW!3# N  ro   r   r   r   s   &  r)   r   @TestBranchPrune.test_single_two_branches_same_cond.<locals>.impl3  2    y} 4K 4Kr+   r   FTNr   r   s   & r)   "test_single_two_branches_same_cond2TestBranchPrune.test_single_two_branches_same_cond1  sS    	 	$!7 9E4=$O$!5!5b!9 ;dE]BOr+   c                   RR lpV P                  V\        P                  ! R 4      3RR.R 4       V P                  V\        P                  ! R4      3RR.R 4       V P                  V\        P                  ! ^
4      3RR.^
4       R # )Nc                 0    V f   ^
pM^(pV e   ^dpW!3# RpW!3# r   ro   r   s   &  r)   r   5TestBranchPrune.test_cond_is_kwarg_none.<locals>.implE  r   r+   FTr   r   )rm   r	   Omittedr   r   r   s   & r)   test_cond_is_kwarg_none'TestBranchPrune.test_cond_is_kwarg_noneC  sz    	 	$t!4 6 $-	/$!7 9E4=$O$!5!5b!9 ;dE]BOr+   c                h   RR lpV P                  V\        P                  ! R 4      3RR.R 4       V P                  V\        P                  ! R 4      3RR.R 4       V P                  V\        P                  ! ^ 4      3RR.^ 4       V P                  V\        P                  ! R4      3RR.R4       R# )r   c                 <    V R 8X  d   ^
pM^(pV R 8w  d   ^dpW!3# RpW!3# )r   r   ro   r   s   &  r)   r   6TestBranchPrune.test_cond_is_kwarg_value.<locals>.implY  s6    DyDy 4K 4Kr+   Nr   TF)r   )rm   r	   r   r   r   r   s   & r)   test_cond_is_kwarg_value(TestBranchPrune.test_cond_is_kwarg_valueW  s    	 	$t!4 6tdK$!5!5d!; =d|	 $!5!5a!8 :T4L!L$!7 9D%=$Or+   c                   a  R  pV 3R lpV! V\         P                  ! R4      3^4       V! V\         P                  ! ^
4      3^ 4       R# )c                     V f   ^
# ^# r   ro   r   s   &r)   fn8TestBranchPrune.test_cond_rewrite_is_correct.<locals>.fno  s    yr+   c                 6  < \        V 4      pS
P                  V4      pS
P                  \        V4      ^4       V^ ,          P                  p\
        P                  ! W54      pS
P                  VP                  R4       VP                  ^ ,          p\
        P                  ! W74      pS
P                  VP                  R4       S
P                  '       d'   \        R4       \        R4       VP                  4        \        W14       S
P                  '       d'   \        R4       \        R4       VP                  4        \
        P                  ! W74      p	S
P                  \        V	\        P                   4      4       S
P                  V	P"                  V4       R# )r~   callbinopr?   r@   NrH   )r*   r;   rP   rQ   condr   get_definitionopr_   rJ   rK   rL   r   
assertTrue
isinstancer   Constvalue)r'   arg_tysbit_valr!   re   pred_var	pred_defncondition_varcondition_opnew_condition_defnr5   s   &&&       r)   check;TestBranchPrune.test_cond_rewrite_is_correct.<locals>.checkt  s*   #D)G #009OS115 'q)..H //BIY\\62%NN1-M#227JL\__g6 {{{hn%g/{{{hm$ "*!8!8!POOJ'9288DE/55w?r+   r   N)r	   r   r   )r5   r   r   s   f  r)   test_cond_rewrite_is_correct,TestBranchPrune.test_cond_rewrite_is_correctl  sC    	
	@@ 	b5>>&)+Q/b5''+-q1r+   c                    R  pV P                  V\        P                  ! ^4      3R.^4       \        p ^sR pV P                  V\        P                  ! ^4      3R.^4       VsR#   Tsi ; i)c                 .    \         ^{8X  d   V # V ^
,           # {   _GLOBALr   s   &r)   r   1TestBranchPrune.test_global_bake_in.<locals>.impl  s    #~2vr+   Fc                 .    \         ^{8X  d   V # V ^
,           # r   r   r   s   &r)   r   r     s    c>Hr6Mr+   TN)rm   r	   r   r   )r5   r   r:   s   &  r)   test_global_bake_in#TestBranchPrune.test_global_bake_in  st    	 	$!5!5a!8 :UGQG 	G" dU%9%9!%<$>JGcGs   /A( (A,c                   a ^{oV3R lpV P                  V\        P                  ! ^4      3R.^4       ^oV3R lpV P                  V\        P                  ! ^4      3R.^4       R# )r   c                 (   < S^{8X  d   V # V ^
,           # r   ro   r   _FREEVARs   &r)   r   2TestBranchPrune.test_freevar_bake_in.<locals>.impl      32vr+   Fc                 (   < S^{8X  d   V # V ^
,           # r   ro   r   s   &r)   r   r     r   r+   TNr   )r5   r   r   s   & @r)   test_freevar_bake_in$TestBranchPrune.test_freevar_bake_in  sc    	 	$!5!5a!8 :UGQG	 	$!5!5a!8 :TFAFr+   c                    RR lpV P                  V\        P                  ! \        P                  ^R4      \        P                  ! R4      3R R .\
        P                  ! R4      R 4       R # )Nc                 $    Vf   ^ pV^ 8  d   ^
# ^# r   ro   )arrayas   &&r)   r   RTestBranchPrune.test_redefined_variables_are_not_considered_in_prune.<locals>.impl  s    y1ur+   Cr   r         rm   r	   Arrayfloat64r   npzerosr   s   & r)   4test_redefined_variables_are_not_considered_in_pruneDTestBranchPrune.test_redefined_variables_are_not_considered_in_prune  sS    	 	$ ;;u}}a= >>&14,((6*D		2r+   c                   RR lpV P                  V\        P                  ! \        P                  ^R4      \        P                  ! R4      3RR.\
        P                  ! R4      R 4       V P                  V\        P                  ! \        P                  ^R4      \        P                  3R R .\
        P                  ! R4      R4       R # )	Nc                 (    ^ pVf   ^
# V^ 8  d   ^# V# r   ro   )r  r  r   s   && r)   r   7TestBranchPrune.test_comparison_operators.<locals>.impl  s     Ay 1uHr+   r  r   FrA   g      (@r   r  r
  r   s   & r)   test_comparison_operators)TestBranchPrune.test_comparison_operators  s    
	 	$ ;;u}}a= >>&14 &/((6*D		2 	$ ;;u}}a= ==+,((6*C		1r+   c                    RR lpV P                  V\        P                  ! \        P                  ^R4      \        P                  \        P                  ! R4      3. RO\
        P                  ! R4      RR 4       R # )Nc                 \    ^pV^8  d   ^pVf   ^pM^pV^ 8  d   ^
# ^V,           V,           # r  ro   r  r   r  bs   &&& r)   r   CTestBranchPrune.test_redefinition_analysis_same_block.<locals>.impl  s:    A1uy1u6A:r+   r  r         ?r   )NFNr  r
  r   s   & r)   %test_redefinition_analysis_same_block5TestBranchPrune.test_redefinition_analysis_same_block  sX    
	 	$ ;;u}}a= ==%..*@C-((6*B		6r+   c                    RR lpV P                  V\        P                  ! \        P                  ^R4      \        P                  \        P                  ! R4      3. RO\
        P                  ! R4      RR 4       R # )Nc                     ^ pV^8  d   ^pV^8  d   ^pVf   V^,          p^V,           # V^,          pV^ 8  d   ^
# ^V,           # r  ro   r  s   &&& r)   r   QTestBranchPrune.test_redefinition_analysis_different_block_can_exec.<locals>.impl  sV    A1u1uyQ
 6M Qq56Mr+   r  r   r  r   )NNNNr  r
  r   s   & r)   3test_redefinition_analysis_different_block_can_execCTestBranchPrune.test_redefinition_analysis_different_block_can_exec	  sX    	 	$ ;;u}}a= ==%..*@C2((6*B		6r+   c                   RR lpV P                  V\        P                  ! \        P                  ^R4      \        P                  ! R4      \        P                  ! R4      3RR .\
        P                  ! R4      R R 4       V P                  V\        P                  ! \        P                  ^R4      \        P                  ! R4      \        P                  3RR .\
        P                  ! R4      R R4       V P                  V\        P                  ! \        P                  ^R4      \        P                  \        P                  ! R4      3R R .\
        P                  ! R4      RR 4       R # )Nc                 b    ^ pVe   ^pVf   V^,          p^V,           # V^,          p^V,           # r  ro   r  s   &&& r)   r   TTestBranchPrune.test_redefinition_analysis_different_block_cannot_exec.<locals>.impl%  s>    A}yQ 6M Q6Mr+   r  r   Tg333333?NNr  r
  r   s   & r)   6test_redefinition_analysis_different_block_cannot_execFTestBranchPrune.test_redefinition_analysis_different_block_cannot_exec!  s   	 	$ ;;u}}a= >>&15>>&3IK,((6*D$		8 	$ ;;u}}a= >>&15==B,((6*D#		7 	$ ;;u}}a= ==%..*@B,((6*C		7r+   c                4    R  pV P                  VRR.4       R# )c                  8   a R oV3R lp V ! 4        S^ 8X  d   R# R# )r   c                     < ^ o R# )r   Nro   r   s   r)   closureRTestBranchPrune.test_closure_and_nonlocal_can_prune.<locals>.impl.<locals>.closureG      r+   TFro   )r.  r   s    @r)   r   ATestBranchPrune.test_closure_and_nonlocal_can_prune.<locals>.implD  s!    A IAvr+   FNro   )rm   r   s   & r)   #test_closure_and_nonlocal_can_prune3TestBranchPrune.test_closure_and_nonlocal_can_pruneA  s    	 	$UH.r+   c                T    R  pV P                  V\        P                  3R.^4       R# )c                 :   a R oV3R lpV! V 4       S^ 8X  d   R# R# )r   c                    < V oR # r   ro   )tr   s   &r)   r.  UTestBranchPrune.test_closure_and_nonlocal_cannot_prune.<locals>.impl.<locals>.closureZ  r0  r+   TFro   )nr.  r   s   & @r)   r   DTestBranchPrune.test_closure_and_nonlocal_cannot_prune.<locals>.implW  s#    A AJAvr+   N)rm   r	   int64r   s   & r)   &test_closure_and_nonlocal_cannot_prune6TestBranchPrune.test_closure_and_nonlocal_cannot_pruneT  s%    	 	$;r+   ro   N)rp   rq   rr   rs   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r#  r)  r2  r<  ru   rv   rw   s   @r)   rz   rz      s}     *IX	IK"Q"$OLO(KP$P(P*)2V4G,2"166,607@/&< <r+   rz   c                      a  ] tR tRt o RtRtR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tRtV tR# )TestBranchPrunePredicatesih  Nc                   VP                   p\        VP                  4       UUu/ uF  w  rEWEbK	  	  pppVP                  4        F	  w  rEWVV&   K  	  \	        \        VP                  4       4       UUu. uF  w  ruVNK	  	  upp4      pVP                  VR7      p	\        P                  ! V	\        4       4      # u uppi u uppi )a  
This takes a python function, pyfunc, and manipulates its co_const
__code__ member to create a new function with different co_consts as
supplied in argument consts.

consts is a dict {index: value} of co_const tuple index to constant
value used to update a pyfunc clone's co_const.
)	co_consts)
__code__rR   rA  itemstuplerY   replacepytypesFunctionTypeglobals)
r5   pyfuncconstspyfunc_codekvrA  r9   
new_constsnew_codes
   &&&       r)   _literal_const_sample_generator9TestBranchPrunePredicates._literal_const_sample_generatorq  s     oo '00E0E&FG&FdaQT&F	GLLNDAaL #&1B*CD*C$!A*CDE
 &&&< ##Hgi88 H Es   B93B?
c                H   R  p\         R9   d   V P                  V^ ^ ^^/4      pM1\         R9   d   V P                  V^^ ^^/4      pM\        \         4      hVP                  P                  pVP                  P                  p\         R9   d&   V P                  VR4       V P                  VR4       M?\         R9   d&   V P                  VR4       V P                  VR4       M\        \         4      hV P                  V! R4      R4       V P                  V! R4      ^4       R# )	c                 0    R pV'       d   R# RpV^,           # PLACEHOLDER1r   PLACEHOLDER2ro   )r   _CONST1_CONST2s   &  r)   r   CTestBranchPrunePredicates.test_literal_const_code_gen.<locals>.impl  s    $G(Q;r+   r   N)r	     )r	  r   )r	     )r	     )r	     rT  )r   r      )NrU  r   rV     )Nr   r   r`  ra  )r   rP  NotImplementedErrorrB  rA  rP   )r5   r   newiconstnconsts   &    r)   test_literal_const_code_gen5TestBranchPrunePredicates.test_literal_const_code_gen  s   	 #66ta1R[IC>>66ta1R[IC%i00((''#V &6 7V%67>>V &9 :V%?@%i00dW-TB'r+   c                Z   R  pV P                   R3V P                  R33 F  w  r#V F|  p\        R9   d   V P                  V^ V/4      pM/\        R9   d   V P                  V^V/4      pM\	        \        4      hV P                  V\        P                  ! R4      3V.R4       K~  	  K  	  R# )c                     R pV'       d   R# R# rU  r   Nro   r   rW  s   & r)   r   <TestBranchPrunePredicates.test_single_if_const.<locals>.impl  s    $G r+   FTr   NrZ  r\  _TRUTHY_FALSEYr   rP  rb  rm   r	   r   r5   r   c_inpr^   constr'   s   &     r)   test_single_if_const.TestBranchPrunePredicates.test_single_if_const      	
 "\\51DLL$3GGLE+??ABE
LD"FF??ABE
LD .i88!!$)?(AE7"&(  Hr+   c                Z   R  pV P                   R3V P                  R33 F  w  r#V F|  p\        R9   d   V P                  V^ V/4      pM/\        R9   d   V P                  V^V/4      pM\	        \        4      hV P                  V\        P                  ! R4      3V.R4       K~  	  K  	  R# )c                     R pV'       g   R# R# rj  ro   rk  s   & r)   r   CTestBranchPrunePredicates.test_single_if_negate_const.<locals>.impl  s    $G r+   FTr   NrZ  r\  rm  rp  s   &     r)   test_single_if_negate_const5TestBranchPrunePredicates.test_single_if_negate_const  ru  r+   c                Z   R  pV P                   R3V P                  R33 F  w  r#V F|  p\        R9   d   V P                  V^ V/4      pM/\        R9   d   V P                  V^V/4      pM\	        \        4      hV P                  V\        P                  ! R4      3V.R4       K~  	  K  	  R# )c                     R pV'       d   R# R# rU  r   r   ro   rk  s   & r)   r   ATestBranchPrunePredicates.test_single_if_else_const.<locals>.impl  s    $Gr+   FTr   NrZ  r\  rm  rp  s   &     r)   test_single_if_else_const3TestBranchPrunePredicates.test_single_if_else_const      	 "\\51DLL$3GGLE+??ABE
LD"FF??ABE
LD .i88!!$)?(AE7"&(  Hr+   c                Z   R  pV P                   R3V P                  R33 F  w  r#V F|  p\        R9   d   V P                  V^ V/4      pM/\        R9   d   V P                  V^V/4      pM\	        \        4      hV P                  V\        P                  ! R4      3V.R4       K~  	  K  	  R# )c                     R pV'       g   R# R# r}  ro   rk  s   & r)   r   HTestBranchPrunePredicates.test_single_if_else_negate_const.<locals>.impl  s    $Gr+   FTr   NrZ  r\  rm  rp  s   &     r)    test_single_if_else_negate_const:TestBranchPrunePredicates.test_single_if_else_negate_const  r  r+   c                   a V P                   R 3V P                  R33 F>  w  rV F3  oV3R lpV P                  V\        P                  ! R4      3V.R4       K5  	  K@  	  R# )FTc                     < S'       d   R S3# R# r   Nro   r   rr  s   &r)   r'   >TestBranchPrunePredicates.test_single_if_freevar.<locals>.func  s    &~- r+   r   Nrn  ro  rm   r	   r   r5   rq  r^   r'   rr  s   &   @r)   test_single_if_freevar0TestBranchPrunePredicates.test_single_if_freevar
  ]    !\\51DLL$3GGLE. !!$)?(AE7"&(  Hr+   c                   a V P                   R 3V P                  R33 F>  w  rV F3  oV3R lpV P                  V\        P                  ! R4      3V.R4       K5  	  K@  	  R# )FTc                     < S'       g   R S3# R# r  ro   r  s   &r)   r'   ETestBranchPrunePredicates.test_single_if_negate_freevar.<locals>.func  s     &~- !r+   r   Nr  r  s   &   @r)   test_single_if_negate_freevar7TestBranchPrunePredicates.test_single_if_negate_freevar  r  r+   c                   a V P                   R 3V P                  R33 F>  w  rV F3  oV3R lpV P                  V\        P                  ! R4      3V.R4       K5  	  K@  	  R# )FTc                 $   < S'       d   R S3# RS3# r   ro   r  s   &r)   r'   CTestBranchPrunePredicates.test_single_if_else_freevar.<locals>.func"  s    &~-&~-r+   r   Nr  r  s   &   @r)   test_single_if_else_freevar5TestBranchPrunePredicates.test_single_if_else_freevar  ]    !\\51DLL$3GGLE.
 !!$)?(AE7"&(  Hr+   c                   a V P                   R 3V P                  R33 F>  w  rV F3  oV3R lpV P                  V\        P                  ! R4      3V.R4       K5  	  K@  	  R# )FTc                 $   < S'       g   R S3# RS3# r   ro   r  s   &r)   r'   JTestBranchPrunePredicates.test_single_if_else_negate_freevar.<locals>.func.  s     &~-&~-r+   r   Nr  r  s   &   @r)   "test_single_if_else_negate_freevar<TestBranchPrunePredicates.test_single_if_else_negate_freevar*  r  r+   c                    V P                   R 3V P                  R33 F=  w  rV F2  pVsR pV P                  V\        P
                  ! R4      3V.R4       K4  	  K?  	  R# )FTc                 .    \         '       d	   R \         3# R# r  )c_test_single_if_globalr   s   &r)   r'   =TestBranchPrunePredicates.test_single_if_global.<locals>.func?  s    ..&(??? /r+   r   N)rn  ro  r  rm   r	   r   r5   rq  r^   cr'   s   &    r)   test_single_if_global/TestBranchPrunePredicates.test_single_if_global8  se     "\\51DLL$3GGLE*+'@ !!$)?(AE7"&(  Hr+   c                    V P                   R 3V P                  R33 F=  w  rV F2  pVsR pV P                  V\        P
                  ! R4      3V.R4       K4  	  K?  	  R# )FTc                 .    \         '       d	   R \         3# R# r  )c_test_single_if_negate_globalr   s   &r)   r'   DTestBranchPrunePredicates.test_single_if_negate_global.<locals>.funcM  s    55&(FFF 6r+   r   N)rn  ro  r  rm   r	   r   r  s   &    r)   test_single_if_negate_global6TestBranchPrunePredicates.test_single_if_negate_globalF  se     "\\51DLL$3GGLE12.G !!$)?(AE7"&(  Hr+   c                    V P                   R 3V P                  R33 F=  w  rV F2  pVsR pV P                  V\        P
                  ! R4      3V.R4       K4  	  K?  	  R# )FTc                 :    \         '       d	   R \         3# R\         3# r   )c_test_single_if_else_globalr   s   &r)   r'   BTestBranchPrunePredicates.test_single_if_else_global.<locals>.func[  s     33&(DDD&(DDDr+   r   N)rn  ro  r  rm   r	   r   r  s   &    r)   test_single_if_else_global4TestBranchPrunePredicates.test_single_if_else_globalT  se     "\\51DLL$3GGLE/0,E
 !!$)?(AE7"&(  Hr+   c                    V P                   R 3V P                  R33 F=  w  rV F2  pVsR pV P                  V\        P
                  ! R4      3V.R4       K4  	  K?  	  R# )FTc                 :    \         '       g	   R \         3# R\         3# r   )#c_test_single_if_else_negate_globalr   s   &r)   r'   ITestBranchPrunePredicates.test_single_if_else_negate_global.<locals>.funcj  s     >>&(KKK&(KKKr+   r   N)rn  ro  r  rm   r	   r   r  s   &    r)   !test_single_if_else_negate_global;TestBranchPrunePredicates.test_single_if_else_negate_globalc  se     "\\51DLL$3GGLE673L
 !!$)?(AE7"&(  Hr+   c                    \         R  4       pV P                  VP                  4       ^ ,          R4       V P                  V! 4       ^ ,          R4       R# )c                  N    \         P                  ! ^4      p RpV'       d   W^ &   V # )r~   i  )r  r  )r1   r:   s     r)   foo6TestBranchPrunePredicates.test_issue_5618.<locals>.foot  s#    XXa[FCq	Mr+   g     Є@N)r   assertPreciseEqualpy_func)r5   r  s   & r)   test_issue_5618)TestBranchPrunePredicates.test_issue_5618r  sG    		 
	 	a 0$7a$/r+   ro   )r~   StringTg@y              @)r    Fg        y                N)rp   rq   rr   rs   rn  ro  rP  rf  rs  ry  r  r  r  r  r  r  r  r  r  r  r  ru   rv   rw   s   @r)   r?  r?  h  sb      +G+G9. (D(.(.(2(2((
(
(((((0 0r+   r?  c                   B   a  ] tR tRt o  ! R R]4      tR tR tRtV t	R# )TestBranchPruneSSAi  c                   &   a  ] tR tRt o R tRtV tR# )$TestBranchPruneSSA.SSAPrunerCompileri  c                &   \        R 4      pVP                  \        R4       VP                  \        R4       VP                  \        R4       VP                  \
        R4       VP                  \        R4       \        pVP                  V P                  4      pVP                  P                  VP                  4       VP                  V P                  4      pVP                  P                  VP                  4       VP                  4        V.# )z
testing pmzanalyzing bytecodezprocessing IRssazdead branch pruningzpreserves the IR as metadata)r   add_passr   r   r   r   r   r   define_typed_pipeliner(   passesr4   !define_nopython_lowering_pipelinefinalize)r5   pmdpbtyped_passeslowering_passess   &    r)   define_pipelines5TestBranchPruneSSA.SSAPrunerCompiler.define_pipelines  s     \*BKK)+?@KKo6KK.KK)>?KK
$BC$C44TZZ@LII\001!CCDJJOOII_334KKM4Kr+   ro   N)rp   rq   rr   rs   r  ru   rv   rw   s   @r)   SSAPrunerCompilerr    s     	 	r+   r  c                    \        V P                  R 7      RR l4       pV P                  V! 4       VP                  4       4       R# )pipeline_classNc                 8    ^pRpV f   RpV'       d   Ve   ^pW#3# )r~   FTro   )pqr   rs   &&  r)   r   4TestBranchPruneSSA.test_ssa_update_phi.<locals>.impl  s+    AAyQ]
 4Kr+   r(  )r   r  r  r  r   s   & r)   test_ssa_update_phi&TestBranchPruneSSA.test_ssa_update_phi  s;     
T33	4	 
5	 	7r+   c                |   \        V P                  R 7      RR l4       pV P                  V! 4       VP                  4       4       VP                  VP
                  ^ ,          ,          P                  R,          pVP                  P                  4        F%  pV P                  . VP                  R4      O4       K'  	  R# )r  Nc                     ^ pV f   ^
pV# ^pV# r  ro   )r  r   s   & r)   r   5TestBranchPruneSSA.test_ssa_replace_phi.<locals>.impl  s$    Ay H Hr+   preserved_irphir   )r   r  r  r  r[   
signaturesmetadatar0   r1   assertFalse
find_exprs)r5   r   r!   r8   s   &   r)   test_ssa_replace_phi'TestBranchPruneSSA.test_ssa_replace_phi  s     
T33	4	 
5	 	7..!34==nM >>((*C5s~~e456 +r+   ro   N)
rp   rq   rr   rs   r   r  r  r  ru   rv   rw   s   @r)   r  r    s      L (8*7 7r+   r  c                   D   a  ] tR tRt o R tR tR tR tR tR t	Rt
V tR	# )
(TestBranchPrunePostSemanticConstRewritesi  c                H   R  pV P                  V\        P                  ! \        P                  ^R4      3RR.\        P
                  ! R4      4       V P                  V\        P                  ! \        P                  ^R4      3RR.\        P
                  ! R4      4       R# )c                 `    V P                   ^8X  d   V P                  ^,          ^8X  d   ^# R# ^
# r  N)ndimshape)r  s   &r)   r   KTestBranchPrunePostSemanticConstRewrites.test_array_ndim_attr.<locals>.impl  s*    zzQ;;q>Q& ' r+   r  FNTrA   r  r  )rm   r	   r  r  r  r  r   s   & r)   test_array_ndim_attr=TestBranchPrunePostSemanticConstRewrites.test_array_ndim_attr  s    	 	$U]]As!C EHLHN((6*	, 	$U]]As!C EHNHP((4.	*r+   c           	         R  pV P                  V\        P                  ! \        P                  ^4      3RR.\	        . RO4      4       V P                  V\        P                  ! \        P                  ^4      3RR.\	        ^^.4      4       R# )c                 J    \        V 4      ^8X  d   V ^,          ^8X  d   ^# R# ^ # )r	  N)rQ   )tups   &r)   r   ETestBranchPrunePostSemanticConstRewrites.test_tuple_len.<locals>.impl  s%    3x1}q6Q;  r+   FNTrA   r~   r  r	  )rm   r	   UniTupler;  rD  r   s   & r)   test_tuple_len7TestBranchPrunePostSemanticConstRewrites.test_tuple_len  s~    	 	$Q!? AEDHDJ	*	, 	$Q!? ADDJDLA-	)r+   c                    \         R  4       pV P                  \        P                  4      ;_uu_ 4       pV! 4        RRR4       V P	                  R\        XP                  4      4       R#   + '       g   i     L7; i)c                  0    \         P                  R 4       R# )gGz?N)floatas_integer_ratioro   r+   r)   testHTestBranchPrunePostSemanticConstRewrites.test_attr_not_len.<locals>.test  s    ""4(r+   Nz$Unknown attribute 'as_integer_ratio')r   assertRaisesr
   TypingErrorassertInstr	exception)r5   r  rh   s   &  r)   test_attr_not_len:TestBranchPrunePostSemanticConstRewrites.test_attr_not_len  s^     
	) 
	) v1122aF 3 	<c!++>NO 32s   A++A;	c           
     l   \         P                  ! R R.4      pV! ^R7      pR pV P                  V\        P                  ! \        P
                  ^R4      3R.\        P                  ! R4      4       \        P                  ! \        P                  ^V4      pV P                  W43R.VRRRR	/R
7       R# )	FakeArrayr  )r  c                 T    V P                   ^8X  d   V P                   # \        4        R# r  )r  object)fas   &r)   r   MTestBranchPrunePostSemanticConstRewrites.test_ndim_not_on_array.<locals>.impl  s    ww!|wwr+   r  FNrG   forceobjT)rF   r  )
collections
namedtuplerm   r	   r  r  r  r  NamedUniTupler;  )r5   r  r  r   FakeArrayTypes   &    r)   test_ndim_not_on_array?TestBranchPrunePostSemanticConstRewrites.test_ndim_not_on_array  s    **;A	A	 	$U]]As!C Ew((6*	, ++EKKIF$ 04&"!+E:d C 	 	Er+   c                    \         R  4       p\        P                  ! R4      \        P                  ! R4      3pV P                  V! V!  VP                  ! V!  4       R# )c                 4    V P                   R VP                   # r   )r  r  )r  r  s   &&r)   r   lTestBranchPrunePostSemanticConstRewrites.test_semantic_const_propagates_before_static_rewrites.<locals>.impl  s    777AFF##r+   N)   ra  r	  r  )r~   r~   )r   r  r  r  r  )r5   r   r_   s   &  r)   5test_semantic_const_propagates_before_static_rewrites^TestBranchPrunePostSemanticConstRewrites.test_semantic_const_propagates_before_static_rewrites	  sQ     
	$ 
	$ &(89dT\\4-@Ar+   c           	        \        \        R 7      R 4       pRpV P                  V! V!  VP                  ! V!  4       VP                  VP
                  ^ ,          ,          pVP                  R,          p\        4       pVP                  P                  4        F  pVP                  R4       Fw  pVP                  VP                  P                  4      pV P                  VP                  \         P"                  4       VP%                  VP                  P                  4       Ky  	  K  	  T P'                  YR U	u0 uF  p	\)        V	4      kK  	  up	4       R# u up	i )r  c                  R    ^ p\        V 4       F  pV\        V4      ,          pK  	  V# r  )r   rQ   )r_   sargs   *  r)   r   STestBranchPrunePostSemanticConstRewrites.test_tuple_const_propagation.<locals>.impl  s(    A%d+SX ,Hr+   r  inplace_binopN)ro   r  ro   )r   r   r  r  r[   r  r  rV   r0   r1   r  find_variable_assignmentrhsnameassertIsInstancer   r   r   addrP   rQ   )
r5   r   inpolr!   binop_constsr8   exprinstr   s
   &         r)   test_tuple_const_propagationETestBranchPrunePostSemanticConstRewrites.test_tuple_const_propagation  s   	5	6	 
7	 "c
DLL#,>?^^DOOA./++n-u>>((*C733DHHMMB%%djj"((;  !1!12 8 +
 	'<1A'<='<s   :E
ro   N)rp   rq   rr   rs   r  r  r	  r  r  r.  ru   rv   rw   s   @r)   r  r    s+     * ) P E(	B> >r+   r  )2r  r	   rF  numpyr  numba.core.compilerr   r   r   numbar   r   r   
numba.corer
   r   r   r   r   r   numba.core.inline_closurecallr   numba.tests.supportr   r   r   r   numba.core.analysisr   r   numba.core.untyped_passesr   r   r   r   r   r   r   r   numba.core.utilsr   r   enable_pyobj_flagsenable_pyobjectr*   r-   rz   r?  r  r  ro   r+   r)   <module>r;     s       > > + + A A  ?; ; M3 3 N M & W %)  "
c(/8 c(LW<); W<tU0 3[ U0p?7( ?7Df>/B f>r+   