+
    :idV                    L   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RI	t
^ RIt^ RIHt ^ RIHtHtHtHtHtHt ^ RIHtHtHtHtHtHtHtHtHtHtHtH t H!t!H"t"H#t#H$t$H%t%H&t&H't' ^ RI(H)t) ^ RIH*t* ^ RI+H,t, ^ R	I-H.t.H/t/H0t0H1t1 ^ R
I2H3t3  ! R R]*Ph                  4      t5R t6R t7]! R. R6ORR7      t8R t9 ! R R]14      t:R t;R t<R t=R t>R t?R t@R tAR tBR tCR tDR tER  tFR! tGR" tHR# tIR$ tJR% tKR& tLR' tMR( tNR) tOR* tPR+ tQR, tRR- tSR. tTR/ tUR0 tVR1 tWR2 tXR3 tYR4 tZR5 t[R# )7    N)make_dataclass)parfor)typesirconfigcompilersigutilscgutils)add_offset_to_labelsreplace_var_namesremove_delslegalize_namesrename_labelsget_name_var_tablevisit_vars_innerget_definitionguardget_call_tableis_pureget_np_ufunc_typget_unused_var_nameis_const_callfixup_var_define_in_scopetransfer_scopefind_max_labelget_global_func_typfind_topo_order)	signature)lowering)ensure_parallel_support)NumbaParallelSafetyWarningNotDefinedErrorCompilerErrorInternalError)ParforLoweringBuilderc                   F   a a ] tR t^-t oRtV 3R lt]R 4       tRtVt	V ;t
# )ParforLowerzhThis is a custom lowering class that extends standard lowering so as
to accommodate parfor.Parfor nodes.c                   < \        V\        P                  4      '       d   \        W4       R # \        SV `  V4       R # N)
isinstancer   Parfor_lower_parfor_parallelsuper
lower_instselfinst	__class__s   &&[/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/parfors/parfor_lowering.pyr.   ParforLower.lower_inst2   s)    dFMM**"4.Gt$    c                    R# )z
Force disable this because Parfor use-defs is incompatible---it only
considers use-defs in blocks that must be executing.
See https://github.com/numba/numba/commit/017e2ff9db87fc34149b49dd5367ecbf0bb45268
T )r0   s   &r3   _disable_sroa_like_opt"ParforLower._disable_sroa_like_opt8   s     r5   r7   )__name__
__module____qualname____firstlineno____doc__r.   propertyr8   __static_attributes____classdictcell____classcell__r2   __classdict__s   @@r3   r'   r'   -   s(     +%   r5   r'   c                 X    VP                   f   \        W4      # VP                   ! W4      # r)   )lowerer_lower_parfor_parallel_std)rF   r   s   &&r3   r,   r,   B   s&    ~~)'::~~g..r5   c                   ^ RI Hp \        4        V P                  P                  pV P                  pV P
                  pV P                  P                  p\        P                  ! V4      V P                  n        \        P                  '       d+   \        RV P                  \        V P                  4      4       V P                  P                  pV P                  p\        P                  '       d   \        R4       VP                  ! 4        VP                  P                   p	VP                  P"                  p
\        P                  '       d,   \        RVP                  R\        VP                  4      4       VP                  P$                   F6  p\        P                  '       d   \        RV4       V P'                  V4       K8  	  VP(                   FF  pW9  g   K  W|,          p\*        P,                  ! WV	4      pV P/                  VP0                  V4       KH  	  / p/ p\2        P4                  P6                  P9                  WP:                  VV P<                  VV4       \        P                  '       d   \        RV4       \        RV4       VP:                  f   Q h\2        P4                  P6                  P?                  WP:                  4      pVP@                  VPB                  pp\        P                  '       d   \        R
V4       \        RV4       \E        V4      p/ p. pV^ 8  Ed   VP                  P"                  p
VP                  P                   p	\G        W
V	R7      pVPI                  \2        PJ                  PL                  PN                  PP                  \S        \2        PJ                  PL                  PN                  PP                  4      R5R7      pVPU                  VPW                  V. R7      \X        PZ                  RR7      p\]        V4       EF  pVV,          pV P                  P                  V,          p\*        P,                  ! V
VV	4      p\_        V4      pVP`                  p\        P                  '       d0   \        RVVVV\X        Pb                  ! V4      V\        V4      4       \e        V\X        Pf                  Ph                  4      '       d   VPj                  ^,           p M^p VPI                  \J        Pl                  \o        \J        Pl                  VPp                  4      \X        Pr                  ! \X        PZ                  V 4      3R\X        Pb                  ! V4      /R7      p!V.p"\e        V\X        Pf                  Ph                  4      '       d   VPU                  \*        Pt                  Pw                  VRV	4      \X        Pr                  ! \X        PZ                  VPj                  4      RR7      p#\]        VPj                  4       FV  p$VPU                  \*        Pt                  Py                  V#V$R	V	4      \X        PZ                  RR7      p%V"P{                  V%4       KX  	  VP}                  V"RR7      p&VPp                  P                  V4      p'VP                  V'\X        Pb                  ! V4      R7      p(VPW                  V!V&V(.R7      p)VPU                  V)VRR7      p*V*VVP0                  &   VP{                  V*4       VV,          P                  p+V+Ee   \e        V\X        Pf                  Ph                  4      '       d   VPI                  \J        P                  \o        \J        P                  VPp                  4      \X        Pr                  ! \X        PZ                  VPj                  4      V3R\X        Pb                  ! V4      /R7      p,VP                  V+VRR7      p-VPW                  V,X#V-V(.R7      p.VPU                  V.VRR7      p/VP{                  V/4       MVP                  V+VRR7      p/MTp/\        P                  '       d   R\        V4      ,           R,           p0\X        P                  ! V04      p1VP                  V0V1R R7      p2\*        P                  ! V2V.R	V	R!7      p3\        \X        P                  VV2P0                  ,          VVP0                  ,          4      V P                  P                  V3&   \        R"V34       V P'                  V34       VVP0                  ,          p4VP                  V44      p5\        P                  ! VV54      p6V
P                  R#V	4      p7V4VV7P0                  &   V6V P                  V7P0                  &   \        P                  ! WPP                  VP0                  4      V5R$7      ;_uu_ 4       p8VP                  V8P                  V64       VP                  V*V7V/R%7       R	R	R	4       EK  	  VP                  P                  4       p9R&V9nT        WqP                  ^ ,          P                  P0                  ,          p:VP                  R',           F'  p;VV;P                  P0                  ,          V:8X  d   K'  Q h	  R(\2        P4                  P6                  nW         \        WWsVV9/ \        V4      V:VP(                  4
      w  p<p=p>p?p@R)\2        P4                  P6                  nW        R*.V=,           p=\E        V4      pA\E        V=4      \E        V4      ,
          VA,
          pB\        P                  '       d=   \        R+V=4       \        R,XB4       \        R-V4       \        R.V4       \        R/XA4       \        VP                  XBXAV=V>VP(                  V4      pC\        P                  '       d   \        R0XC4       VP                   U;u. uF&  p;V;P                  V;P                  V;P                  3NK(  	  pDp;\        P                  '       d#   \        R1VP                  4       \        R2XD4       \        V V<XCV>V=V?XDVVVVP                  V:VP(                  X@4       V^ 8  d   \        VVV VX4       V F4  pEV P'                  \*        P                  ! VEP0                  V	R37      4       K6  	  W`P                  n        \        P                  '       d   \        R44       R	# R	#   + '       g   i     EK  ; i  R)\2        P4                  P6                  nW        i ; iu up;i )6aS  Lowerer that handles LLVM code generation for parfor.
This function lowers a parfor IR node to LLVM.
The general approach is as follows:
1) The code from the parfor's init block is lowered normally
   in the context of the current function.
2) The body of the parfor is transformed into a gufunc function.
3) Code is inserted into the main function that calls do_scheduling
   to divide the iteration space for each thread, allocates
   reduction arrays, calls the gufunc function, and then invokes
   the reduction function across the reduction arrays to produce
   the final reduction values.
)get_thread_countzlowerer.fndescr,   zinit_block =  zlower init_block instr = 	alias_maparg_aliasesNzparfor_redvars:zparfor_reddict:)rF   scopeloc)fobjftypeargs)rQ   num_threads_var)rhstypnamereduction_infodtype)rO   rP   rQ   kwsshaperedarr_shaperedshapeonedimtuple_size_varrU   )cvalrT   redarrinit_val)r^   rT   rU   redtosetzres_print1 for redvar :	str_constrQ   varargrN   res_print_redvarz$loop_index)intp)objindexvalnumpy   NNTFschedzfunc_args = znum_inputs = parfor_outputs = parfor_redvars = znum_reductions = zgu_signature = zloop_nests = loop_ranges = )rN   z_lower_parfor_parallel doner7   )bnumba.np.ufunc.parallelrI   r    contexttyping_contextbuilderfndesctypemapcopyr   DEBUG_ARRAY_OPTprinttypevarmapdump
init_blockrN   rM   bodyr.   racesr   Var_alloca_varrU   numbaparforsr   find_potential_aliases_parforparamsfunc_irget_parfor_outputsredvarsreddictlenr%   bind_global_functionnpufuncparallel_iget_num_threadsr   assigncallr   rg   rangeredtyp_to_redarraytyperW   DTyper*   npytypesArrayndimemptyr   
_typingctxUniTupleExprgetattrstatic_getitemappendmake_tuple_variableresolve_value_typemake_const_variabler`   fullDEBUG_ARRAY_OPT_RUNTIMEstrStringLiteralPrintr   none	calltypesget_value_typer
   alloca_onceredefine	for_rangeloadvarstoreri   setitemflagserror_model
loop_nestsindex_variablesequential_parfor_lowering_create_gufunc_for_parfor_bodybool_create_shape_signatureget_shape_classesstartstopstepcall_parallel_gufunc#_parfor_lowering_finalize_reductionDel)FrF   r   rI   	typingctx	targetctxru   orig_typemaprw   r|   rN   rM   instrracevarrvtyprvrK   rL   parfor_output_arraysparfor_redvarsparfor_reddictnredvarsredarrs
to_cleanuppfbdrget_num_threadsrR   ired_name
redvar_typredvarredarrvar_typreddtype	redarrdimglbl_np_emptysize_var_listredshape_varj	onedimvarsize_varr^   dt
empty_call
redarr_varr`   full_func_nodeinit_val_var	full_callra   res_print_strstrconsttyplhs	res_printnum_thread_typentllvm_typealloc_loop_varnumba_ir_loop_index_varloopr   index_var_typlfunc	func_argsfunc_sigfunc_arg_typesexp_name_to_tuple_varnum_reductions
num_inputsgu_signatureloop_rangesvsF   &&                                                                    r3   rG   rG   I   s
    9..IIooG >>))L!YY|4GNNW^^0DEnn$$G^^F&'




C##E ov00#tF<M<M7NO""''!!!-u55! (
 << $E,B/	   IK	MM66v}}g(/KQk9%m[) ==$$$ ==//BB%+^^V^^NN00 >"HGJ!|!!''##%gL  44((::%ehhnn&=&=&O&OP 5 
  ,,

?
4

" ' $ xA%a(H //9JVVE8S1F 3:>M$**H%%%$!KK)#)	 *enn&:&:;;&OOa/		
 "66XX&rxx1A1ABNN5::y9 ekk(34 7 M --M *enn&:&:;;$||=uzz:??C'  ,   z/A %GG22<D#N!JJ- !- !I
 "((3 0 00$4 1 H
 ##66x@D**%++h:O*PBM2GJM & J
 $.GFKK j)%h/88H#j%..*>*>?? &+%?%?WW.rww8H8HI!NN5::zG$ %ekk(&;< &@ &N $)#<#<%$' $= $L !&

&lL"-M !+ !I  %||%&'  ,  H %%h/$88%$'  9  H "111$<s6{$JS$PM"'"5"5m"DK33*'( 4 C !#sFm04#!?I:CEJJ=DSXX=N=DV[[=Q;SGNN,,Y7 ,i8&&y1 &o&:&:;O#22?CK$00+FN ',nn]C&H#4CG+001 <JGNN2778 ""7OOO<P<P,QXcddhldjj.9 *4KQYZ edG !V LLEE--a0??DDEMr""q'',,->>> #6:EMM3	@
 #AWE2O]FLL#:		 				 ;@7 	I%I(NY#&:";;nLJni(oz*!#78!>2!>2*  L . 7=6G6GH6GAGGQVVQVV,6GKHov001,  !|+GWno	

 266!&&c23  *NN+, c edd2 ;@70 Is   1t+t /,t?t!t<_ReductionInfoT)frozenc           
     j   VP                  4        F  w  rVVP                  P                  V,          pVP                  P                  VP                  ,          pVP	                  V4      p	\        W5,          VVVVV	R7      p
V
P                  P                  e   \        M\        pV! WWJ4       K  	  R# )zQEmit code to finalize the reduction from the intermediate values of
each thread.
redvar_inforedvar_namer   r   
redarr_typr`   N)
itemsrv   rw   rU   r   r   r   redop_lower_trivial_inplace_binops_lower_non_trivial_reduce)r   r   rF   r   thread_count_varr   r   r   r   r`   reduce_infohandlers   &&&&&       r3   r   r     s     $+==? ^^++K8
^^++JOO<
??;/$(5#!!!
 "--33? 11 	 	!1?- $3r5   c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# ) ParforsUnexpectedReduceNodeErrori  c                ,   < \         SV `  R V 24       R# )z!Unknown reduce instruction node: N)r-   __init__r/   s   &&r3   r  )ParforsUnexpectedReduceNodeError.__init__  s    <TFCDr5   r7   )r:   r;   r<   r=   r  r@   rA   rB   rC   s   @@r3   r  r    s     E Er5   r  c                   VP                   P                   EF
  p\        W4      '       d   M\        WCP                  R4      '       dJ   VP
                  P                  p\        WQW#4      pVP                  WdP                  P                  R7       Mp\        WCP                  R4      '       dJ   VP
                  P                  p\        WQW#4      pVP                  WdP                  P                  R7       M\        V4      h\        WVVP                  4      '       g   EK   M	  \        P                  '       d>   VP                  pVP                  V P                    RXP"                   RV R2V4       R# R# )z+Lower trivial inplace-binop reduction.
    inplace_binopr]   binopz	: parfor z reduction  =N)r   reduce_nodes_lower_var_to_var_assign_is_right_op_and_rhs_is_initr   valuefn_emit_binop_reduce_callstorevartargetrU   r  _fix_redvar_name_ssa_mismatchr   r   print_variablerN   r:   )r   rF   r  r  r1   r  redvar_resultvarnames   &&&&    r3   r   r     s;    ''44#G22)$0G0GYYB3-M ]1A1AB)$0G0GQQB3-M ]1A1AB 3488 )$#.#:#:< <3 54 %%%))zzl)BKK=G9BG	
 &r5   c           	       a
 VP                    R2o
VP                  P                  P                  S
VP                  4       VP                  VP                  4      p\        P                  ! VP                  V4      ;_uu_ 4       pVP                  pVP                  P                   F  p\        W4      '       d   M\        V\        P                   4      '       d   \"        ;QJ d-    V
3R lVP%                  4        4       F  '       g   K   RM"	  RM! V
3R lVP%                  4        4       4      '       d1   \'        WaV4      pVP)                  VS
4       VP+                  V4       M\-        V4      h\/        WVVP                   4      '       g   K   M	  RRR4       \0        P2                  '       d1   VP                   p	VP5                  V P6                   RV	 R2V	4       R# R#   + '       g   i     LX; i)zFLower non-trivial reduction such as call to `functools.reduce()`.
    #initc              3   @   <"   T F  qP                   S8H  x  K  	  R # 5ir)   r]   ).0var	init_names   & r3   	<genexpr>,_lower_non_trivial_reduce.<locals>.<genexpr>  s     N=McHH	1=Ms   TFNz: parfor non-trivial reduction r  )r   rv   rw   
setdefaultr   r   rU   r
   r   ru   ri   r   r  r  r*   r   Assignany	list_vars_emit_getitem_callr  r.   r  r  r   r   r  rN   )r   rF   r  r  num_thread_llvalr   tidr1   elemr  r  s   &&&&      @r3   r  r    s    **+51INN%%i1G1GH '7'<'<=			7??,<	=	=jj++88D'66T299--NT^^=MNNT^^=MNNN)#D  y1""4( 7t<< -Vd'2'>'>@ @% 9 
>, %%%))zzl9'"E	
 &- 
>	=s&   A"G'("G'+G'9AG'G''G7	c                4   \        V\        P                  4      '       dx   \        VP                  \        P                  4      '       dN   V P                  VP                  P                  4      pV P                  W!P                  P                  R7       R# R# )zYLower Var->Var assignment.

Returns True if-and-only-if `inst` is a Var->Var assignment.
r]   TF)	r*   r   r#  r  r   r   rU   r  r  )rF   r1   loadeds   && r3   r  r     s`    
 $		""z$**bff'E'E1kk&6&67r5   c                   R pVP                   pVP                  pVP                  pVP                  VP                  P
                  4      pWp3p\        VP                  V\        P                  4      p	VP                  WCW4      p
V
# )z%Emit call to ``redarr_var[idx]``
    c                     W,          # r)   r7   )r_   ri   s   &&r3   reducer_getitem+_emit_getitem_call.<locals>.reducer_getitem.  s
    }r5   )ru   rs   r   r   r   rU   r   r   r   rg   compile_internal)idxrF   r  r.  ru   ctxr   arg_arrrQ   sigr)  s   &&&        r3   r&  r&  +  sv     ooG
//C''Jook4499:G>D
K**J


CC#DDKr5   c                   R pR p\         P                  V\         P                  V\         P                  V\         P                  V\         P
                  V\         P                  V\         P                  V\         P                  V\         P                  V\         P                  V/
V ,          pVP                  pVP                  pVP                  p	VP                  VP                  P                   4      p
\"        P$                  '       d   VP                  P&                  P)                  VP*                  4      p\,        P.                  ! VP                  V.RVP0                  R7      pVP2                  P4                  p\7        \8        P:                  WP                  P                   ,          WP                   ,          4      VP2                  P<                  V&   VP?                  V4       VP                  VP                   4      pWVP@                  3p\7        VPB                  \8        PD                  WPB                  4      pVPG                  WVV4      pV# )z;Emit call to the ``binop`` for the reduction variable.
    c                 L    Tp\        V 4       F  pW1V,          ,          pK  	  V# r)   r   thread_countr_   initcr   s   &&&  r3   reduction_add._emit_binop_reduce_call.<locals>.reduction_add?  &    |$ANA %r5   c                 L    Tp\        V 4       F  pW1V,          ,          pK  	  V# r)   r7  r8  s   &&&  r3   reduction_mul._emit_binop_reduce_call.<locals>.reduction_mulE  r>  r5   Nrd   )$operatoriaddisubaddsubimul	ifloordivitruedivmulfloordivtruedivrs   ru   r   r   r   rU   r   r   rM   getr   r   r   rN   rv   rw   r   r   r   r   r.   r`   r   uintpr0  )r  rF   r  r  r<  r@  kernelr2  ru   r   r3  init_varr   rw   arg_thread_countrQ   r4  r  s   &&&&              r3   r  r  ;  s    	}}mm}M=m=- F //CooG''Jook4499:G%%%))//33K4K4KLHH(((3D
	 ..((.7JJ 6 6 ; ;<MM"/
  + 	9%'7'<'<={';';<D
Z9O9OC ((#tDMr5   c                   \        V \        P                  4      '       g   R# V P                  p\        V\        P                  4      '       g   R# VP
                  V8w  d   R# VP                  P                  V R28w  d   R# R# )zDIs ``inst`` an inplace-binop and the RHS is the reduction init?
    Fr  T)r*   r   r#  r  r   oprS   rU   )r1   r   rS  rS   s   &&& r3   r  r  t  s`     dBII&&
**Cc277##
vv|
ww||+e,,r5   c                   V P                   P                  p\        V\        P                  4      '       d    VP                  V4      pVP                  pVP                  P                  pWg8H  pV'       dT   W2P                  P                  8w  d:   VP                  VP                  P                  4      p	VP                  WR7       R# R#   \         d    Y2P                  P                  8H  p Li ; i)z5Fix reduction variable name mismatch due to SSA.
    r]   TF)r~   rM   r*   r   r#  	get_exactunversioned_namer  r"   rU   r   r  )
r   rF   r1   r   rM   reduction_varredvar_unver_nametarget_unver_nameis_same_source_varrj   s
   &&&&      r3   r  r    s     ##E$		""	H!OOK8M !. > > $ < <!2!G kk...oodkk&6&67   7+  	A "-0@0@!@		As   C #C21C2c                  aaa \         P                  '       d<   \        RWW54       VR,           F!  p\        RV\        V4      V ! WvR7      4       K#  	  \	        V4      V,
          pVR,           U	u. uF  qV9  d
   V ! WR7      MRNK  	  p
p	\        4       pV
 F'  pV'       g   K  V F  pVP                  V4       K  	  K)  	  V'       d   \        V4      ^,           M^ pV
P                  ^ V34       VP                  V4       V^,           pVP                  V4       / o\        R4      pV F#  pV^ 8  g   K  \        V4      SV&   V^,          pK%  	  \        V4      pRV/oV3R lo. p. p^ pRp\         P                  '       d%   \        RV4       \        R	V
4       \        R
V4       \        W4       F  w  ppV^,           pV'       d6   \        ;QJ d    . VV3R lV 4       F  NK  	  5M! VV3R lV 4       4      pMRpVV8  d5   VP                  \        V.\        VR,          4      ,           4      4       K  VP                  V4       VV,          pK  	  VV3# u up	i )z&Create shape signature for GUFunc
    r   rl   argument)rw   alatest_alphac                 p   < V ^ 8  d	   W,          # SR;;,          ^,          uu&   \        SR,          4      # )r   r^  )chr)r;  	class_map
alpha_dicts   &&r3   
bump_alpha+_create_shape_signature.<locals>.bump_alpha  s2    6<~&!+&z.122r5   rQ   classesthreadcount_ordinalc              3   6   <"   T F  pS! VS4      x  K  	  R # 5ir)   r7   )r  r;  rc  ra  s   & r3   r   *_create_shape_signature.<locals>.<genexpr>  s     Cs!Z955ss   )r7   )r   ry   rz   r{   r   setrE  maxinsertordr`  ziptupler   list)r   r   r   rQ   r   r   rw   r   
num_inoutsr  re  	class_set_class	max_classthread_num_classalphabetnrf  gu_singu_soutcountsyms_sinclsargdim_symsrb  rc  ra  s   &&&&&&&                  @@@r3   r   r     s"    'TQbA*aa*;A*OP  T^+JaefhaijaiZ]U:J 6PUUaiGjI6a    '0I"QINN1yl#MM) 1}MM"#I3xH
q&h-9Q<q=8  h- 8,J3 FGEHfdi!#%89&S	uCsCuuCsCCHHJ MM%!4 5Xb\8J JKLMM(# H ' Ge ks   2I"c                 ^    \        V P                  4       F  w  r\        R VRV4       K  	  R# )    rJ   N)	enumerater   rz   )blockr   r1   s   &  r3   _print_blockr    s%    UZZ(fad# )r5   c                l    \        V 4      pV F"  pW,          p\        RV4       \        V4       K$  	  R# )z%Pretty-print a set of IR blocks.
    zlabel: N)wrap_find_toporz   r  )	body_dict
topo_orderlabelr  s   &   r3   _print_bodyr    s2      	*J iU r5   c                    V P                  4       p\        VP                  4       4      p\        VP                  4       4      pW,          P                  pW,          P
                  P                  \        P                  ! W$4      4       V# r)   )	rx   minkeysrk  rN   r   r   r   Jump)	loop_bodyblocksfirst_label
last_labelrN   s   &    r3   wrap_loop_bodyr    sa    ^^Ffkkm$KV[[]#J


 
 C
""277;#<=Mr5   c                 x    \        V P                  4       4      pW,          P                  R R W,          n        R # )Nri  )rk  r  r   )r  r  s   & r3   unwrap_loop_bodyr    s.    Y^^%&J!*!6!;!;CR!@Ir5   c                    W9   d   R# W9   d%   VP                  V 4       VP                  V 4       R# VP                  V 4       R# )a8  If the variable is already defined more than once, do nothing.
Else if defined exactly once previously then transition this
variable to the defined more than once set (remove it from
def_once set and add to def_more set).
Else this must be the first time we've seen this variable defined
so add to def_once set.
N)rE  remove)a_defdef_oncedef_mores   &&&r3   add_to_def_once_setsr    s7     		UUr5   c                   V P                  \        P                  4      pV EFE  pVP                  P                  p\        WV4       VP                  p	\        V	\        P                  4      '       dC   \        V	P                  \        P                  4      '       d   V	P                  P                  WX&   \        V	\        P                  4      '       dQ   V	P                  R8X  d@   V	P                  P                  V9   d%   V	P                  P                  V	P                  3W8&   \        V	\        P                  4      '       d   V	P                  R8X  dr   V	P                  P                  V9   dW   W9P                  P                  ,          w  rW9   d'   WZ,          p\!        W4      '       g   \        WV4       M\        WV4       \        V	\        P                  4      '       g   EK  V	P                  R8X  g   EK  V	P"                   FX  p\        V\        P$                  4      '       d   VP                  pWM,          p\'        VRR4      '       g   KL  \        WV4       KZ  	  EKH  	  R# )a  Effect changes to the set of variables defined once or more than once
for a single block.
block - the block to process
def_once - set of variable names known to be defined exactly once
def_more - set of variable names known to be defined more than once
getattr_taken - dict mapping variable name to tuple of object and attribute taken
module_assigns - dict mapping variable name to the Global that they came from
r   r   mutableFN)
find_instsr   r#  r  rU   r  r  r*   Globalpytypes
ModuleTyper:   r   rS  attrr   r   rQ   r   r   )r  r  r  getattr_takenrw   module_assignsassignments
one_assignr  rS   base_obj	base_attrbase_mod_nameargvaravtypes   &&&&&&         r3   compute_def_once_blockr    s    ""299-K!
!!&&Uh7c299%% #))W%7%788(+		(:(:%c277##)(;		RZ@Z$'IINNCHH#=M c277##&(8SXX]]m=[ #0">H) !/ 8$]>> )XF %XBc277##&(8 ((fbff--#[[F  69e44 )8D #M "r5   c                 H    \        V 4      p\        V4      p\        V 4       V# r)   )r  r   r  )r  r  r  s   &  r3   r  r  S  s$    I&F (JYr5   c           
     "   \        V 4      pV F}  pW,          p\        WW#WE4       VP                   FU  p	\        V	\        P
                  4      '       g   K%  \        V	P                  WW4V4       \        V	P                  WW4V4       KW  	  K  	  R# )zCompute the set of variables defined exactly once in the given set of blocks
and use the given sets for storing which variables are defined once, more than
once and which have had a getattr call on them.
N)	r  r  r   r*   r   r+   r~   compute_def_once_internalr  )
r  r  r  r  rw   r  r  r  r  r1   s
   &&&&&&    r3   r  r  Y  ss      	*J  	uaJJD$..&tMdrs)$..(mftu  r5   c                R    \        4       p\        4       p/ p/ p\        WW4W4       W#3# )zRCompute the set of variables defined exactly once in the given set of blocks.
    )rj  r  )r  rw   r  r  r  r  s   &&    r3   compute_def_oncer  m  s1     uHuHMNi8Gdr5   c                     \        V \        P                  4      '       g   Q hVP                  V P                  4       V # r)   )r*   r   r   rE  rU   )r  varsets   &&r3   	find_varsr  w  s.    c266""""
JJsxxJr5   c                 ^   V P                   P                  V9   d8   VP                  V R 34       \        P                  ^8  d   \        RV R4       R# WPP                   P                  ,          p\        4       p\        V P                  \        V4       V U	U
u0 uF  w  rV	P                   P                  kK  	  pp	p
W,          pVP                  V4      pW,          p\        P                  ^8  d   \        RV RVRV4       \        V4      ^ 8X  d   \        V P                  RV4      '       d|   \        P                  ^8  d   \        RW4       VP                  V 4       \        V\        P                  P                   4      '       g   WP                   P                  .,          pR	# \        V4      ^ 8  d8   VP                  V R
34       \        P                  ^8  d   \        RV R4       R# VP                  V R34       \        P                  ^8  d   \        RV R4       R# u up
p	i )zstored arrayInstructionz9could not be hoisted because the created array is stored.Fz_hoist_internal:zuses:zdiff:NzWill hoist instructionT
dependencyz-could not be hoisted because of a dependency.znot purez+could not be hoisted because it isn't pure.)r  rU   r   r   ry   rz   rj  r   r  r  
differencer   r   r*   r   r   r   )r1   dep_on_param
call_tablehoistednot_hoistedrw   stored_arraystarget_typeusesassgn_unhoistableuse_unhoistdiffs   &&&&&&&       r3   _hoist_internalr  |  s   {{=(D.12!!Q&-'bc++**+K5DTZZD15@A[5<<$$[KA$K??<(DD" $wE
4yA~'$**dJ??!!Q&*D>t+u~~';';<<[[--..Lt9q=l34%%*mT+Z[
  j12%%*mT+XY- Bs   !H)c                 ~  aaa	 VP                    EF#  p\        V\        P                  \        P                  34      '       d}   V P                  VP                  P                  4       \        SVP                  P                  ,          R R4      '       d(   SP                  VP                  P                  4       K  K  \        V\        P                  4      '       d4   \        V SVP                  S4       \        V SVP                  S4       EK  \        V\        P                   4      '       g   EK&  VP                  o	VV	V3R lp\        S	\        P"                  4      '       g   EK]  S	P$                  R9   d   S	P&                   F  pV! V4       K  	  EK  S	P$                  R8X  d(   S	P&                   F  pV F  pV! V4       K  	  K  	  EK  S	P$                  R8X  g   EK  \)        S	P*                  4      S	P,                   Uu. uF  q^,          NK  	  up,            F  pV! V4       K  	  EK&  	  R# u upi )r  Fc                    < \        V \        P                  4      '       g   Q S4       h\        SV P                  ,          R R4      '       d   SP                  V P                  4       R# R# )r  FN)r*   r   r   r   rU   rE  )itemitemssetrS   rw   s   &r3   add_to_itemset+find_setitems_block.<locals>.add_to_itemset  sM    !$//44/7499-y%@@LL+ Ar5   	build_mapr   N)build_tuple
build_list	build_set)r   r*   r   StaticSetItemSetItemrE  r  rU   r   r  r   r+   find_setitems_blockr~   find_setitems_bodyr  r#  r   rS  r   rp  rQ   rX   )
setitemsr  r  rw   r1   r  r  pairxrS   s
   &f&f     @r3   r  r    s   

dR--rzz:;;LL))*
 wtzz/EBBTZZ__- Cfmm,,(DOOWMx4>>7Kbii(( **C,
 #rww''66GG #		&t, !*VV{* #		$(D*40 %) !* VVv% $SXX1H1A$$1H H H&t, !I? > 2Is   
H:c                P    VP                  4        F  w  rE\        WWS4       K  	  R# )z
Find the arrays that are written into (goes into setitems) and the
mutable objects (mostly arrays) that are written into other arrays
(goes into itemsset).
N)r   r  )r  r  r  rw   r  r  s   &&&&  r3   r  r    s!     ")H? *r5   c           	         \        V \        P                  4      '       d   \        V P                  \        P                  4      '       d   V P                  P
                  R 8X  dg   V P                  P                  P                  V9   dB   W P                  P                  P                  ,          pVR\        .8X  d   \        WW#WEV4      # R# )r   r   F)
r*   r   r#  r  r   rS  r   rU   r   r  )r1   r  r  r  r  rw   r  	call_lists   &&&&&&& r3   empty_container_allocator_hoistr    s    4##4::rww''




*zz334	"%"4z#.H Hr5   c                    \         P                   ! V 4      p. p. p\        W4      w  rx\        V4      w  r\        4       p\        4       p\	        WW4       \        \        V4      P                  V4      4      p\        P                  ^8  d   \        RVRVRVRVRV 4
       V F  p\        WV4       K  	  VP                  4        EF  w  r. pVP                   EFw  p\        VWIWVW,4      '       d   K  \        V\        P                   4      '       d3   VP"                  P$                  V9   d   \'        VWIWVW,4      '       d   Kk  M\        V\(        P*                  4      '       d   . p\        P                  ^8  d   \        R4       VP-                  4        VP.                  P                   F}  p\        VVWWbV4      '       d   K  \        V\        P                   4      '       d3   VP"                  P$                  V9   d   \'        VWIWVVV4      '       d   Kl  VP1                  V4       K  	  VVP.                  n        VP1                  V4       EKz  	  VVn        EK  	  WV3# )rm   zhoist - def_once:z	setitems:z	itemsset:zdep_on_param:zparfor_params:r   )rx   r  r   rj  r  rp  r  r   ry   rz   r  r   r   r  r*   r   r#  r  rU   r  r   r+   r}   r~   r   )parfor_paramsr  rw   wrapped_blocksr  r  r  r  r  r  reverse_call_tabler  r  sir  r  	new_blockr1   new_init_blockib_insts   &&&&                r3   hoistr    s%   99]+LGK *)=H'5n'E$ZuHuHx9>L)44X>?L"!8[(KQY[jlx  {K  MZ  	[R84  ")	JJD.t\#*L LD")),,1A1AX1M"4#*L L 	L
 D&--00!#))Q.(OIIK#33G6w"[8M M $Wbii88++x7*7L+2+35 5 %"))'2  4 (6$T"; < 
A *B r5   c                 T    \        V \        P                  P                  4      '       * # r)   )r*   r   r   r   )redtypes   &r3   redtyp_is_scalarr    s    '5>>#7#7888r5   c                    ^p\        V \        P                  P                  4      '       d   WP                  ,          pV P
                  p \        P                  P                  WR4      # )z^Go from a reducation variable type to a reduction array type used to hold
per-worker results.
C)r*   r   r   r   r   rW   )redtypr   s   & r3   r   r     sL     I&%....//[[ 	>>377r5   c                    \        V \        P                  P                  4      '       g   Q h\        P                  P                  V P                  V P
                  V P                  4      # )zYGiven a reduction array type, find the type of the reduction argument to the gufunc.
    )r*   r   r   r   rW   r   layout)redarraytyps   &r3   redarraytype_to_sigr    sL     k5>>#7#78888>> 1 1;3C3C[EWEWXXr5   c                r    \        V 4      pVP                  4        F  w  r4W48w  g   K  W,          W&   K  	  V# )a,  We use ir_utils.legalize_names to replace internal IR variable names
containing illegal characters (e.g. period) with a legal character
(underscore) so as to create legal variable names.
The original variable names are in the typemap so we also
need to add the legalized name to the typemap as well.
)r   r   )namesrw   outdictr  ys   &&   r3   legalize_names_with_typemapr  $  s5     U#G6 GJ	  
 Nr5   c                     \        V \        P                  4      '       d   V P                  ^ 8X  d   V P                  # V # )r   )r*   r   ArrayCompatibler   rW   )r  s   &r3   to_scalar_from_0dr  4  s.    !U**++66Q;77NHr5   c
                2   \         P                  ^8  d   \        R4       VP                  P                  p
\
        P
                  ! VP                  4      p\        V4       \        VP                  4      pVP                   Uu. uF  qP                  P                  NK  	  ppVP                  p\        P                  P                  P!                  W4      pV P"                  P$                  p\        P                  P                  P'                  V P(                  WV P"                  P*                  4      w  pp\-        \/        \1        V4      \1        V4      ,
          \1        V4      ,
          4      4      p\         P                  ^8  d]   \        RVR\3        V4      4       \        RVR\3        V4      4       \        RVR\3        V4      4       \        RVR\3        V4      4       . p/ p/ p^ p. pV EF  pVV,          p\5        V\6        P8                  4      '       g!   \5        V\6        P:                  4      '       d   VP<                  pVP>                  pV\         P@                  8:  g   Q h. p\C        V4       FL  pR\E        V4      ,           pVPG                  V4       VPG                  V4       VV3VV&   V^,          pVVV&   KN  	  VVV&   VPG                  V4       K  \5        V\6        PH                  4      '       g!   \5        V\6        PJ                  4      '       d   VP<                  pVP6                  p V\         P@                  8:  g   Q h. p\C        V4       FS  pR\E        V4      ,           pVPG                  V4       VPG                  V4       VV3VV&   V^,          pV V,          VV&   KU  	  VVV&   VPG                  V4       EK  VPG                  V4       EK  	  Tp\         P                  ^8  d   \        RVR\3        V4      4       V	PM                  \1        V4      4      p	V	 F,  p!R	V!,          p"\N        PP                  ! \S        V"V
4      4       K.  	  \U        WW P"                  P*                  4       . p#. p$V Fi  p%V%R
,           p&V#PG                  V&4       \W        VV%,          4      p'V$PG                  V'4       \Y        V'4      p(V&V9   d   VV&,          V(8X  g   Q hKd  V(VV&&   Kk  	  VV,           V#,           p\         P                  ^8  dQ   \        RVR\3        V4      4       \        RVR\3        V4      4       \        RVR\3        V4      4       \[        V4       \]        VV,           V,           V4      p)\         P                  ^8  d/   \        R\-        V)P_                  4       4      R\3        V)4      4       \]        W4      p*V U+u. uF  p+V*V+,          NK  	  p,p+\         P                  ^8  d   \        R\-        V*P_                  4       4      R\3        V*4      4       \        RV,R\3        V,4      4       V F4  p-\        RV-4       \        RVV-,          R\3        VV-,          4      4       K6  	  V U+u. uF  p+\a        VV+,          4      NK  	  p.p+VV,            U+u. uF  p+VV+,          NK  	  up+V$,           p/\         P                  ^8  d   \        RV.4       \        RV/4       \c        VV)4       Tp0V U+u. uF  p+V)V+,          NK  	  pp+Tp1. pRp2\C        \        V14      4       F  p3V2'       dc   V3\        V4      8  dS   \5        V.V3,          \6        Pd                  Pf                  4      '       d"   VPG                  V1V3,          R,           4       Km  VPG                  V1V3,          4       K  	  \c        VV*4       \i        V4      p4\k        RV44      p5\         P                  ^8  d   \        RVR\3        V4      4       R\m        \o        V4      4      Pq                  RR4      ,          p6\         P                  '       d   \        R\3        V64      RV64       Rp7V7RV6,           R,           RPs                  V4      ,           R ,           ,          p7R!\t        R"\        /p8VP_                  4        EF  w  p9p:VV9,          p;V7R#V)V9,          ,           ,          p7\5        V;\6        PJ                  4      '       g!   \5        V;\6        P:                  4      '       d   R$p<MRp<V<'       Ed   \w        \x        V P(                  V94      p=R%p>\         P                  '       d   \        R&V=\3        V=4      4       V=e   \5        V=\z        P|                  4      '       dd   V=P~                  R'8X  dS   \w        \x        V P(                  V=P                  4      p>\         P                  '       d   \        R(V>\3        V>4      4       Mj\5        V=\z        P                  4      '       dK   VV=P                  ,          p>\         P                  '       d"   \        R(V>\3        V>4      V>P                  4       V>Ee&   \5        V>\z        P                  4      '       g!   \5        V>\z        P                  4      '       dI   V>P                  p?\         P                  '       d   \        R)V?\3        V?4      4       V?V8V>P                  &   M\5        V>\6        P                  P                  4      '       ds   V>P                  P                  R*4      ^ ,          p@\         P                  '       d,   \        R+X@V>P                  \3        V>P                  4      4       V>P                  V8X@&   MG\         P                  '       d   \        R,4       \        R-\E        V94      ,           V9P                  4      hV7R.V;P                  P                  ,           R*,           ,          p7\        V:V;P                  4       F+  w  pApBV7VBR/,           V)VA,          ,           R0,           ,          p7K-  	  MOT7R1RPs                  V: UCu. uF  pCV)VC,          NK  	  upC4      ,           ,          p7\        V:4      ^8X  d
   V7R0,          p7V7R2,          p7EK  	  \C        \        V4      4       Fs  p3V2'       g   K  \5        V.V3,          \6        Pd                  Pf                  4      '       g   K@  V7R#V1V3,          ,           R3,           VV3,          ,           R2,           ,          p7Ku  	  R4pD\        V#4      ^ 8  d!   V7R#XD,           R.,           ,          p7V7R5,          p7\        V#V4       F  w  p&p%V7R#V)V%,          ,           R/,           V)V&,          ,           R6,           XD,           R7,           ,          p7\         P                  '       g   K_  V7R8,          p7V7R9V)V%,          ,           R0,           V)V%,          ,           R:,           ,          p7V7R;V)V&,          ,           R0,           V)V&,          ,           R:,           ,          p7K  	  \C        V4       Fz  pE\C        VE^,           4       F  pFV7R#,          p7K  	  XEpGV7R<V,VE,          ,           R=,           \E        VG4      ,           R>,           \E        VGV,           4      ,           R?,           ,          p7K|  	  \         P                  '       dz   \C        V^,           4       F  pFV7R#,          p7K  	  V7R@,          p7\C        V4       F6  pEV7RAV,VE,          ,           RB,           V,VE,          ,           R0,           ,          p7K8  	  V7R2,          p7\C        V^,           4       F  pFV7R#,          p7K  	  V7V5RC,           ,          p7\        V#V4       F  w  p&p%\         P                  '       d=   V7RDV)V%,          ,           R2,           ,          p7V7REV)V&,          ,           R2,           ,          p7V7R#V)V&,          ,           R6,           XD,           RF,           V)V%,          ,           RG,           ,          p7K  	  V7RH,          p7\         P                  '       d.   \        RI\3        V74      RGV74       \        RJV8\3        V84      4       / pH\        V7V8VH4       VHV6,          pI\         P                  '       d   \        RK\3        XI4      RGVI4       \        P                  ! XI4      pJ\         P                  '       dF   \        RL\3        XJ4      4       VJP                  4        \        RM\3        V4      4       \[        V4       \i        XJP                  4      pK/ pLV5.\/        V)P                  4       4      ,           V,,           pMVKP_                  4        FB  w  pAp%VAXM9   d   K  VP                  P                  P                  XAV
4      P                  XLVA&   KD  	  \c        XJP                  XL4       \         P                  '       d   \        RN4       XJP                  4        \6        Pd                  Pg                  V^RO4      .V.,           pN\         P                  '       d   \        RP\3        XN4      RGVN4       \        XJP                  4      ^,           pO\        VVO4      p\        V4      ^,           pP\         P                  '       Ed$   VP_                  4        EF  w  pQpRVRP                  4       pSVSP                  4        VRP                  p
VRP                  pTVRP                   EF  pUXSPG                  VU4       \5        VU\z        P                  4      '       g   K7  VXUP                  P                  ,          \6        P                  9  d   Ki  RQP                  XUP                  P                  4      pV\6        P                  ! VV4      pWXTP                  RRV
4      pX\z        P                  ! \z        P                  ! VVV
RS7      VXV
RT7      pYVWVVXP                  &   XSPG                  VY4       \z        P                  ! VXVUP                  .R%V
RU7      pZVSPG                  VZ4       \        P                  P                  P                  \6        P                  VVXP                  ,          VVUP                  P                  ,          4      p[V[V P"                  P*                  VZ&   EK  	  XSVXQ&   EK  	  \         P                  '       d   \        RV4       \[        V4       \        V4      p\\        WVV\4      w  p]p^XJP                  \        VJP                  P                  4       4      ,          p_V_P                  R%Rd V],           V_P                  Rd,          .,           V_nY        \        V4       V P                  RW,          p`RXV]RYV^/V`P                  VP                  &   \         P                  '       d   \        RZ4       \[        V4       XJP                  P_                  4        EF  w  pQpR\        VRP                  4       EF  w  ppU\5        VU\z        P                  4      '       g   K)  XUP                  P                  V58X  g   KF  XUP                  p
XRP                  pT\z        P                  ! VTV
4      paVRP                  R%V VanY        VRP                  V^,           R% VRnY        \        VP                  4       4      pbVaPG                  \z        P                  ! VbV
4      4       VP_                  4        F  w  ppc\        VcXT4      XJP                  V&   K!  	  \        VP                  4       4      pdXRXJP                  XP&   XaVJP                  XQ&   VJP                  Vd,          PG                  \z        P                  ! VPV
4      4        M	  EK   M	  \         P                  '       d   \        R[4       XJP                  4        \        XJP                  4      VJnR        \        VJP                  4       \         P                  '       d4   \        R\4       XJP                  4        \        R]V4       \        R^V4       VP                  peV'       g)   \         P                  '       d   \        R_4       R$Vns        \        XJP                  4        ! R` Ra\        P                  4      pf\        P                  ! VVVJXN\6        P                  VVVfRb7      pgXeVns        \        \6        P                  .VNO5!  ph\         P                  '       d   \        RcXh4       XgV0XhV/V3# u upi u up+i u up+i u up+i u up+i u upCi )eaV  
Takes a parfor and creates a gufunc function for its body.
There are two parts to this function.
1) Code to iterate across the iteration space as defined by the schedule.
2) The parfor body that does the work for a single point in the iteration space.
Part 1 is created as Python text for simplicity with a sentinel assignment to mark the point
in the IR where the parfor body should be added.
This Python text is 'exec'ed into existence and its IR retrieved with run_frontend.
The IR is scanned for the sentinel assignment where that basic block is split and the IR
for the parfor body inserted.
z'starting _create_gufunc_for_parfor_bodyzparfor_params = rJ   ro   zparfor_inputs = rp   expanded_tuple_var_z$parfor_inputs post tuple handling = zVariable %s used in parallel loop may be written to simultaneously by multiple workers and may result in non-deterministic or unintended results._arrzloop_indices = zloop_body = zparam_dict = zind_dict = zlegal_loop_indices = zpd = z
pd type = znew param_types:znew func_arg_types:Fparam__sentinel__zlegal parfor_params = z__numba_parfor_gufunc_%s-r  zgufunc_name  zdef z(sched, z, z):
r   r   r  TNz	func_def:r   znamed_tuple_def:zgval:(zname:z0Didn't find definition of namedtuple for globls.zCould not find definition of z = =,z = (z)
z = np.ascontiguousarray(!ParallelAcceleratorGufuncThreadIdz*numba.np.ufunc.parallel._iget_thread_id()
[z]
z<    print("thread id =", ParallelAcceleratorGufuncThreadId)
zF    print("initial reduction value",ParallelAcceleratorGufuncThreadId,z.shape)
z>    print("reduction array",ParallelAcceleratorGufuncThreadId,zfor z in range(sched[z	], sched[z] + np.uint8(1)):
zprint("z",z = 0
zD    print("final reduction value",ParallelAcceleratorGufuncThreadId,zD    print("final reduction array",ParallelAcceleratorGufuncThreadId,z] = 
z    return None
zgufunc_txt = zglobls:zgufunc_func = zgufunc_ir dump zloop_body dump zgufunc_ir dump after renaming r  zgufunc_param_types = z{} =rc   )r  rN   )r  r  rN   rd   zparfor loop bodyparfor_diagnosticsr  r  zAfter hoistingz#gufunc_ir last dump before renamingzgufunc_ir last dumpr   rw   z(No aliases found so adding noalias flag.c                   &   a  ] tR tRt o R tRtV tR# )<_create_gufunc_for_parfor_body.<locals>.ParforGufuncCompileri<  c                d   ^ RI Hp \        P                  pV! 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.# )r   )PassManagerfull_parfor_gufunc)
numba.core.compiler_machineryr  r   DefaultPassBuilderdefine_parfor_gufunc_pipelinestatepassesextend/define_parfor_gufunc_nopython_lowering_pipelinefinalize)r0   r  dpbpmparfor_gufunc_passeslowering_passess   &     r3   define_pipelinesM_create_gufunc_for_parfor_body.<locals>.ParforGufuncCompiler.define_pipelines=  s    A--C12B#&#D#DTZZ#P II1889!QQRVR\R\]OII_334KKM4Kr5   r7   N)r:   r;   r<   r=   r  r@   rA   )rD   s   @r3   ParforGufuncCompilerr  <  s     
	 
	r5   r  )pipeline_classz5finished create_gufunc_for_parfor_body. kernel_sig = ri  )wr   ry   rz   r~   rN   rx   r  r   r   r   r   rU   r   r   r   r   r   rv   rw   get_parfor_reductionsr   r   sortedrp  rj  r{   r*   r   r   NamedUniTuplerz  rW   PARFOR_MAX_TUPLE_SIZEr   r   r   Tuple
NamedTupler  warningswarnr!   replace_var_with_arrayr   r  r  r  r   r  r   r   r   r   r   hexhashreplacejoinr   r   r   r   r   rS  r   Argr  FreeVarr  
containersBaseNamedTuplesplitinstance_classr#   r:   rn  fieldsr   execr   run_frontendr}   r  valuesrM   r   r   r   clearr   r#  r  number_domainformatr   Constr   coretypingr   r   r  r  r  r  r  metadata
hoist_infoidr  Blockr  r   rk  r   noaliasr   CompilerBase
compile_ir)irF   r   rw   r   r   r   localshas_aliasesr   r   rN   r  
parfor_dimr   loop_indicesr  parfor_outputsr   r   parfor_inputstuple_expanded_parfor_inputstuple_var_to_expanded_namesexpanded_name_to_tuple_varnext_expanded_tuple_varparfor_tuple_paramspipi_typetuple_counttuple_dtypethis_var_expansionr   expanded_nametuple_typesracemsgparfor_redarrsparfor_red_arg_typesr  arrredarraytype	redarrsig
param_dictind_dictr   legal_loop_indicespdparam_typesr   parfor_argsparfor_params_origascontigpindexloop_body_var_tablesentinel_namegufunc_name
gufunc_txtgloblstup_var	exp_namestup_type	named_tupfunc_defnamed_tuple_defgvalnamed_tuple_namerU   
field_namer  gufunc_thread_id_vareachdimindent	sched_dimloclsgufunc_func	gufunc_ir	var_tablenew_var_dictreserved_namesgufunc_param_typesgufunc_stub_last_label	new_labelr  r  r  rM   r1   strvalr   r   
assign_lhs
print_noder4  r  r  r  start_blockdiagnostics
prev_blockbody_first_labelbbody_last_label	old_aliasr  kernel_func
kernel_sigsi   &&&&&&&&&&                                                                                               r3   r   r   :  sQ   , "78




C 		&**+I	V&&'J393D3DE3Da$$))3DLE MMM]]))<<VSNnn$$G%*]]%9%9%O%O0H0H&J"NN   	!"M " -d=6IJ!>3^8LM -d=6IJ!>3^8LM $& "$!#"+gu~~..*WeFYFY2Z2Z!--K!--K&">">>?>!#;' 5<S8T T,33MB"))-8 >@G*=9'1,')4& ( /A'+&&r*--GUEUEU1V1V "--K!--K&">">>?>!#;' 5<S8T T,33MB"))-8=?G*=9'1,')4Q& ( /A'+&&r*(//3] ^ 1M"4mS$}J]^ S01E=?CD 	0c:;	 
 5Wnn6N6NO NFlc"-gcl;##L1'5	'>3<9,-,$GCL  "N2^CM" -d=6IJsD4FGnid9o>I -]^-KNa-acjkJ"  "$	 +<AH/;<|!(1++|<"mVHNN$45sDNK##$		&
  B'2,S$wr{2CD  
 ;HH-Q$WQZ0-KH+8>+IK+IQgajj+IKNbbN" +.#^4 i,K,9:MqZ]]MM:&MH./0S''{6*ENN,@,@AA  !3F!;G!CD  !3F!;< 1 i*,Y7'8KLM"$		! -DL!!#s+-Knd;/kBJ &;&ii.0289 9J B'F
 :??A7#fz'222
x!1!122x!4!455II9 ^W__gFH"O%%%k8T(^<#x11KK6)&+NGOOX]]&[O---0/4CXY"&&11&-hmm&<O---0/"?3_5I5IK*		::

;;*00D---gtT$Z837F?//01A1A1P1PQQ'6';';'A'A#'Fq'I$---g'7-<<"?#A#ABD 0?/M/MF+,)))LM#$Cc'l$R%,[[2 2%("9"9"B"BBSHHJ$'	8??$C jj3.D1AACGG
 %D &499Y-OYjmmY-O#PPPJ9~" c!
e
u Bx M*+8
;v#68L8LMM6$6v$>>,-/<V/DEGLM NJ ,
 ?
>Qf33e;;
CC
 7Sfz#.c?#%()+?@BGH 	H
)))[[Jdgqrugvvy||  @J  KN  @O  O  R]  ]  ]J\_ijm_nnqtt  xB  CF  xG  G  JU  U  UJ 8 $GaK(F& J )	v)'23)* 9~& #	#
 9%& '' -- 	.
	 % %%%JN+F& J ,h
Z(G$!3G!<<uDGYZaGbbehhhJ )e
 
Q'f
 (-(**J7S)))beopsettw|||Jbeopsettw|||Jfz#.&')/02<S/BDHI 	I
 8 %%JotJ/zBif.EVU#$K[ 14E%%k2Ii1i1I #9#3#34IL#_Z !"$67N__&	c&!'!2!2!8!8!A!A$!L!Q!QL ' i&&5./....1c# $&12##$		  ,I,<,<=A %Y0FGIy)A-I %%%%OO-LE5

IOO))CKKE

  &dBII..t{{//08K8KK  $]]4;;+;+;<F"'"5"5f"=K..c:C!#C1P253"@J(3GCHH%$$Z0 "$T[[/A$TW!XJ$$Z0**++55ejj+2388+<+24;;3C3C+DFC <?GNN,,Z83 #4  )Ie? .B  !I#I.N 7NSG[""3y'7'7'<'<'>#?@K"'',w6+:J:J2:N9OOKY ""#78K)2G)6)EK699% I "((..0u ,GAtII #';;#3#3}#Dhh  XXeS1
"'**Ra.
"ZZA/
#&y~~'7#8  !!"''*:C"@A (oo/FQ*8E*BI$$Q' 0"%inn&6"7.3	  +*4	  '   188GGIs+-? -B G 1J 34$Y%5%56I	  !#$gui!I!!!<=i../x44  %%

+-K EM5::;(:;JEzRZA[[[y FD = IK ;@ .Ps*   AeAeAe+AeAeAec           	         . pVP                    EFO  p\        V\        P                  4      '       Ed   VP                  P
                  V 9   Ed   VP                  pVP                  P                  p\        P                  ! ^ V4      pVP                  RV4      p	\        P                  W)P
                  &   \        P                  ! WV4      p
VP                  V
4       VP                  RV4      pW%P                  P
                  ,          W+P
                  &   VP                  \        P                  ! VP                  W4      4       \        P                  ! VP                  WV4      p\        \        P                   \        P"                  P%                  W%P                  P
                  ,          ^R4      \        P&                  W%P                  P
                  ,          4      W<&   VP                  V4       EK  \        V\(        P*                  4      '       d0   \-        V ^ VP.                  /W#4       \-        WP0                  W#4       VP                  V4       EKR  	  V# )r   z$const_ind_0z$valr  )r   r*   r   r#  r  rU   rN   rM   r3  r   r   rN  r   r  r  r   r   r   r   rg   r   r+   replace_var_with_array_internalr~   r  )varsr  rw   r   r  r1   rN   rM   
const_node	const_varconst_assignval_varsetitem_nodes   &&&&         r3   replace_var_with_array_in_blockr  [  s   I

dBII&&4;;+;+;t+C((CKK%%E!S)J~s;I&+kkGNN#99ZC@L\*nnVS1G$+KK,<,<$=GLL!RYYtzz7@A::dkk9sKL&/

ENN009I9I1JAsSUZU_U_ahititiyiyaz'|I#\*fmm,,+D1doo2F[+D..'U/ 0 r5   c                 Z    VP                  4        F  w  rE\        WW#4      Vn        K  	  R # r)   )r   r  r   )r  r  rw   r   r  r  s   &&&&  r3   r  r  w  s#    !)4T'U
 *r5   c                     \        WW#4       V  F@  pW$,          pVP                  VR 4       \        P                  P	                  V^R4      W$&   KB  	  R # )Nr  )r  popr   r   r   )r  r  rw   r   r   el_typs   &&&&  r3   r!  r!  {  sE    #DWHAt^^))&!S9
 r5   c                +  a aagah S P                   ohS P                  og^ RIHpHp \
        P                  '       ds   \        R4       \        RVP                  VP                  VP                  VP                  4       \        RV4       \        RV4       \        RV4       \        RV4       \        P                  ! V4      w  ppVP                  P                  VP                   P"                  4      pVw  ppV! 4        V! VVVVRR	R
7      pVP$                  pVP                  P'                  4        \
        P                  '       d   \        RVV4       VhV 3R lp\)        V4      p\+        V4       F  pVV,          w  pppV! V4      pV! V4      pV^8X  g   Q hV! V4      pVVV3VV&   \
        P                  '       g   KQ  \        RP-                  V4      VVV4       \.        P0                  ! SgRP-                  V4      VVV4       K  	  \2        P4                  P7                  ^4      p\2        P4                  P9                  V4      p\2        P4                  P9                  V4      pShP;                  \<        P>                  4      p ShP;                  \<        P@                  4      p!\2        P4                  P9                  V 4      p"\2        P4                  P9                  V"4      p#\2        P4                  P9                  V!4      p$\2        P4                  P9                  V$4      p%ShPC                  \<        P@                  ^ 4      p&ShPC                  \<        P@                  ^4      p'V'PD                  p(ShPG                  V 4      p)VPI                  ^ 4       VPI                  ^ 4      p*\
        P                  '       d   \        RVPJ                  4       VPJ                  '       d   T p+T"p,T#p-MT!p+T$p,T%p-\.        PL                  ! SgV+ShPC                  \<        P@                  V4      RR7      p.\.        PL                  ! SgV+ShPC                  \<        P@                  V4      RR7      p/\+        V4       EF  pVV,          w  pppVPD                  V(8w  d   SgPO                  VV(4      pVPD                  V(8w  d   SgPO                  VV(4      pVPD                  V(8w  d   SgPO                  VV(4      pSgPQ                  VV'4      pSgPS                  VSgPU                  V.ShPC                  \<        P@                  V4      .4      4       SgPS                  VSgPU                  V/ShPC                  \<        P@                  V4      .4      4       EK  	  \.        PV                  ! SgPX                  \2        P4                  P[                  V!. 4      RR7      p0\.        PV                  ! SgPX                  \2        P4                  P[                  \2        P4                  P]                  4       V!.4      RR7      p1\.        PV                  ! SgPX                  \2        P4                  P[                  \2        P4                  P7                  \<        P>                  P^                  4      . 4      R4      p2SgPa                  V2. 4      p3SgPa                  V0. 4      p4\.        Pb                  ! SgSgPe                  RV3V3PE                  ^ 4      4      4      ;_uu_ 4        \.        P0                  ! SgRV34       ShPf                  Pi                  Sg\j        R/4       RRR4       \2        P4                  P[                  V!V!V!V"V".4      p5\.        PV                  ! SgPX                  V5RR7      p6SgPa                  V6V3ShPC                  \<        P@                  V4      V.V/.4      p7SgPa                  V1V&.4       ShPC                  \<        P@                  V^,          4      p8SgPm                  V7V84      p9\2        P4                  P[                  V,V!.4      p:\.        PV                  ! SgPX                  V:RR7      p;SgPa                  V;V9.4      p<\.        PL                  ! SgV,4      p=SgPS                  V<V=4       \
        P                  '       d   ^M^ p>\2        P4                  P[                  V"V!V"V"V!V,V .4      p?VPJ                  '       d%   \.        PV                  ! SgPX                  V?RR7      p@M#\.        PV                  ! SgPX                  V?RR7      p@SgPa                  X@ShPC                  \<        P@                  V4      V.V/V7SgPo                  V=4      ShPC                  \<        P>                  V>4      .4       V UAu. uF%  pAS Pq                  V	VA,          P$                  4      NK'  	  pBpA\)        V4      pC\)        V4      VC,
          pDVgVV 3R lpEVRVD  UAu. uF  pAXE! VA4      NK  	  upAXB,           pF\)        VF4      pG\)        V4      ^,           pH\.        PL                  ! SgVShPC                  \<        P>                  ^VG,           4      RR7      p. pISgPS                  SgPs                  SgPo                  V=4      V4      V4       VIPu                  ShPC                  \<        P>                  V)4      4       / pJ\+        VG4       EF  pXFV,          pKVV,          pLVV,          pMSgPU                  VShPC                  \<        P>                  V^,           4      .4      pNVXD8  d   ShPw                  XM4      ! ShSgXK4      pO\.        Px                  ! SgVOPz                  VMP|                  4      pP\+        \)        VP4      4       F  pQXIPu                  XPVQ,          4       K  	  SgPS                  SgPs                  XOP~                  V4      XN4       EK  \        XM\<        P                  4      '       Ed   XLV9   d   XMP                  \<        P                  8w  d   ShP                  XMP                  4      M\2        P4                  P7                  ^4      pR\.        PL                  ! SgVR4      pSSgPS                  XKVS4       SgPS                  SgPs                  VSV4      XN4       VKVS3XJXL&   XIPu                  ShPC                  \<        P>                  ShPG                  VR4      4      4       EK  ShPw                  XM4      ! ShSgXK4      pO\.        Px                  ! SgVOPz                  VMP|                  4      pP\+        \)        VP4      4       F  pQXIPu                  XPVQ,          4       K  	  SgPS                  SgPs                  XOP~                  V4      XN4       EK  VXH8  d   \        XM\<        P                  4      '       d"   XMPD                  pTShP                  SgXKVMVT4      pKMXMpT\        XT\<        P                  4      '       g   ShP                  XT4      M\2        P4                  P7                  ^4      pR\.        PL                  ! SgVR4      pUSgPS                  XKVU4       Mg\        XM\<        P                  4      '       g   ShP                  XM4      M\2        P4                  P7                  ^4      pR\.        PL                  ! SgVR4      pUSgPS                  SgPs                  XUV4      XN4       EK  	  / pV. pWV*^ ,          .pWShPC                  \<        P>                  ^V,          4      VVV*^ ,          &   \)        V4      \)        XF4      8X  g   Q h\)        V4      \)        V4      8X  g   Q h\)        V4      \)        VV,           4      8X  g   Q h\)        V4      \)        VP                  R ,          4      8X  g   Q h\        VXFVVV,           4       EF  w  pLpKpMpX\        VM\<        P                  P                  4      '       d   XMP|                  \)        XX4      ,
          pM^ p\
        P                  '       d   \        R!XLR"XXR#XMR$V4       XX EF  pY\
        P                  '       d   \        R%XLR&XM4       XLV9   d%   ShPC                  \<        P>                  ^4      XVXY&   MQShPw                  XM4      ! ShSgXK4      pO\.        Px                  ! SgVOP                  VMP|                  4      pZVZV,          XVXY&   XYXW9   g\   \
        P                  '       d5   \        R'XYR(V4       \.        P0                  ! SgVYR),           XVVY,          4       XWPu                  XY4       V^,           pEK  	  EK  	  \)        XV4      ^,           p[\.        PL                  ! SgV V[R*R7      pZSgPS                  V7VZ4       ^pXW F  pY\
        P                  '       d'   \.        P0                  ! SgXYR),           XVVY,          4       SgPS                  XVXY,          SgPU                  XZShPC                  \<        P>                  V4      .4      4       V^,           pK  	  XG^,           \)        XI4      ,           p\\.        PL                  ! SgV ShPC                  \<        P>                  V\4      R+R7      p]SgPS                  ShPC                  \<        P>                  ^V,          V),          4      V]4       \+        VG4       FO  pT&p^SgPU                  X]ShPC                  \<        P>                  ^V,           4      .4      pNSgPS                  V^VN4       KQ  	  \+        \)        XI4      4       F[  pQSgPU                  X]ShPC                  \<        P>                  ^XG,           VQ,           4      .4      pNSgPS                  XIVQ,          VN4       K]  	  \.        P                  ! V4      p_\2        P4                  P[                  \2        P4                  P]                  4       VV"V"V.4      p`\.        PV                  ! SgPX                  V`V4      paShP                  P                  VP                  4       \
        P                  '       d   \.        P0                  ! SgR,Xa4       SgPa                  XaVXZX]X_.4       \
        P                  '       d   \.        P0                  ! SgR-Xa4       SgPa                  V1V4.4       \2        P4                  P[                  \2        P4                  P]                  4       V,.4      pb\.        PV                  ! SgPX                  VbR.R7      pcSgPa                  VcSgPo                  V=4      .4       XJP                  4        Fl  w  pdpeVew  pKpSSgPU                  VSShPC                  \<        P>                  ^ 4      .4      pfSgPS                  SgPo                  Vf4      S P                  Vd4      4       Kn  	  ShP                  P                  VP                  4       R#   + '       g   i     EL; iu upAi u upAi )0z>
Adds the call to the gufunc function from the main function.
)build_gufunc_wrapper_launch_threadsmake_parallel_loopzouter_sig = rq   	expr_argsexpr_arg_typesr   FT)cache
is_parforszparallel function = c                    < \        V \        P                  4      '       d   SP                  V P                  4      # SP                  \        P                  V 4      # r)   )r*   r   r   r   rU   get_constantr   rN  )r   rs   rF   s   &r3   
load_range(call_parallel_gufunc.<locals>.load_range  s>    a  ??166**''Q77r5   z'call_parallel_gufunc loop_ranges[{}] = zloop range[{}]: %d %d (%d)
z%Parfor has potentially negative start
dim_starts)sizerU   	dim_stopsget_parallel_chunksizer]   set_parallel_chunksizer   z<=znum_threads: %d
Nget_sched_sizeallocate_scheddo_scheduling_signeddo_scheduling_unsignedc                   < V S9   d0   SV ,          w  rSP                  V4      pSP                  W24      pV# SP                  V 4      # )a  Given a variable name, if that variable is not a new name
introduced as the extracted part of a tuple then just return
the variable loaded from its name.  However, if the variable
does represent part of a tuple, as recognized by the name of
the variable being present in the exp_name_to_tuple_var dict,
then we load the original tuple var instead that we get from
the dict and then extract the corresponding element of the
tuple, also stored and returned to use in the dict (i.e., offset).
)r   extract_value)r  orig_tupoffsetrd  resru   r   rF   s   &    r3   load_potential_tuple_var6call_parallel_gufunc.<locals>.load_potential_tuple_varM  sM     %%4Q7Hooh/G''8CJ??1%%r5   pargsrl   zvar =zgu_sig =ztype =zi =zvar = z type = z
dim_sym = z, i = z = %d
pshapepstepszbefore calling kernel %p
zafter calling kernel %p
deallocate_sched)z@Invalid number of threads. This likely indicates a bug in Numba.)Qrs   ru   rr   r  r  r   ry   rz   rQ   return_typerecvrpysigr	   normalize_signaturelibraryget_functionrv   llvm_func_namerU   _ensure_finalizedr   r   r2  r
   printfllvmliter   IntTypePointerTyper   r   rg   rN  r  r{   get_abi_sizeofr  signedr   sextrF  r   gepget_or_insert_functionmoduleFunctionTypeVoidTypebitwidthr   if_unlikelyicmp_signed	call_convreturn_user_excRuntimeErrorrJ  loadr   bitcastr   
make_arrayunpack_tuplestridesr   datar*   r  rW   booleanget_data_typeOptionalcastBooleanrn  r   r   rY   get_null_valueactive_code_libraryadd_linking_libraryr   getvar)irF   cresr   	outer_sigr  r  r   r   r   
redarrdictr~   r   r   r   r  r  rQ   r  	llvm_funcsinsoutinfowrapper_namer  num_dimr   r   r   r   byte_t
byte_ptr_tbyte_ptr_ptr_tintp_tuintp_t
intp_ptr_tintp_ptr_ptr_tuintp_ptr_tuintp_ptr_ptr_tzerooneone_typesizeof_intp	sched_sig
sched_typesched_ptr_typesched_ptr_ptr_typer  r  get_chunksizeset_chunksizer   num_threadscurrent_chunksizeget_sched_size_fntyr  num_divisions
multiplier
sched_sizealloc_sched_fntyalloc_sched_funcalloc_spacern   
debug_flagscheduling_fntydo_schedulingr  r   r   ninoutsr  all_argsnum_argsnum_inpsarray_stridesrv_to_arg_dictr}  r  atydstaryr  r   rT   rv_argunpacked_atyptrsig_dim_dictoccurrencesgu_sigdim_symshapesnshapes	num_stepsstepsstepsizer  fntyr  dealloc_sched_fntydealloc_sched_funckr   only_elem_ptrru   rs   si   f&&&&&&&&&&&&f                                                                                         @@r3   r   r     sl    ooGooG, "#ninni.C.Cooy	0,k9%/nl+ !44Y?D+))$++*D*DEIIC 	4d&+>D99LLL""$$lD98 +G7^'NtT5!$qyy$t,A!!!;BB1EuNN7$B$I$I!$L $.  [[  #F((0J[[,,Z8N##EJJ/F$$U[[1G((0J[[,,Z8N++))'2Kkk--k:OQ/D


u{{A
.CxxH((0K MM!
I5}7K7KL
#+
$, $$'"6"6KK#"(46J ##'"6"6KK#"(35I 7^'NtT::!LL1E99 <<h/D99 <<h/D{{4%7;;((Q()*	+
 	dGKK	)0)=)=ekk1)M(NP 	Q & 22  "-%'M
 22  !5!5!7'C%'M
 44  !4!4UZZ5H5H!I2NO ,,3K]B7			Wg&9&9$2=2B2B12E'G 
H 
Hw 3[A))'<3]	^
H #++227Wgz[e<fg33N LL+292F2Fu{{T[2\2<2;2= >M
 LL' %%ekk7Q;?J]J7J  {{//	J55 ,,/*>K8EMM+u%,,,!Jkk..Wj*g~vVXO66w~~7F<RT  66w~~7F<TV
 LL  W&'19mLL!5!5JJ
",-. =DDGqwz!}112GGD7|H)nx'G&( 6?x5HI5H(+5HIGSH8}H3x!|H!!JJL D MMM'//',,u"5zBDI--ejj+FGN8_qklQkk$!5!5ejj!a%!H IJ<$$S)'7C@C**7CKKJG3w<($$WQZ0 )MM'//#((J?EU2233e|))u}}4 ,,SYY7$KK//2  !,,Wc:c6*goofjA3G'*Fms#$$W%9%9%**gF\F\]`Fa%bc((-gwD!..wSXXNs7|,A!((4 -goochh
CSI8|c5>>22#&88L!,,wS,GC#&L(u}}EE ,,\:$KK//2  ))'37c3' )emm<< ,,S1$KK//2  ))'37MM'//#z:C@e l LKQ<.K!(!5!5ejj!g+!NL1y>S]***y>S0000y>St_,,,y>S!34444!$Y%3S4Z"AS#vc5>>//003v;&AA!!!'3
FHc5!LG%%%hZ5e|(/(<(<UZZ(KW%((-gwD --gsyy#((K(.q	W%{*))),1=NN7Gi,?gAVW""7+AA "A: ,!#G  &wXNFMM-(	A!!!NN7Gi$7g9NO!7;;((

A'($)	*
 E  1s=11Ig22JJ	#)13E MM'&&uzz1w;3LM 8_kk%'"6"6uzz1q5"I!JKh$  3}%&kk$$JJHq 0234 	mA&, ' !!*-D;;##HKK$8$8$:%3Z%/%=>D 
	'	'l	KB33DLLAw <bALLdFE401w ;R@LL!2 34 "11(++2F2F2H>JZ[ 77! LL#gll5&9%:;$$&1VFW-A-A%**a-P,QRgll=17>>!3DE '
 33DLLAU
H 
H 
H| E2 Js   6:AV>?+AWAWV>AW	r   )\rx   rB  r   r  r  dataclassesr   llvmlite.irr  rk   r   r   numba.parforsr   
numba.corer   r   r   r	   r
   numba.core.ir_utilsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   numba.core.typingr   r   numba.parfors.parforr    numba.core.errorsr!   r"   r#   r$   #numba.parfors.parfor_lowering_utilsr%   Lowerr'   r,   rG   r   r   r  r   r  r  r&  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r   r  r  r!  r   r7   r5   r3   <module>r(     sf        &      E E     * (  8  F(.. */R-j
   !@HE} E
"
J$
L	 6r!FCJ$A <E|v(
$L!-F@
3 j9
8Y _\B8V:RBr5   