Caml1999I037"-Flambda_utils0find_declaration@*Closure_id!t@@@O@'Flambda5function_declarations@@@P4function_declaration@@@Q@@R@@S@ $middle_end/flambda/flambda_utils.mliXTTYk@@%@@@9find_declaration_variable@$!t@@@T@"5function_declarations@@@U(Variable!t@@@V@@W@@X@"]#^6s@@FA@@2find_free_variable@2Var_within_closure!t@@@Y@E/set_of_closures@@@Z#!t@@@[@@\@@]@CaDb@@gB@@.function_arity@\4function_declaration@@@^#intA@@@_@@`@Zf88[f8p@@~C@@>variables_bound_by_the_closure@}!t@@@a@{5function_declarations@@@bZ#Set!t@@@c@@d@@e@{p ? ?|q d @@D@@-can_be_merged@!t@@@f@!t@@@g$boolE@@@h@@i@@j@u  u  F@@E@@M@@L@@2initialize_symbols@'program@@@@&Symbol!t@@@@#Tag!t@@@@ !t@@@@@@@@@@@@@@dOOf{@@M@@0imported_symbols@ 'program@@@2#Set!t@@@@@@ h h@@-N@@5needed_import_symbols@"'program@@@K#Set!t@@@@@@"j#j@@FO@@?introduce_needed_import_symbols@;'program@@@A'program@@@@@@9l:lg@@]P@@+root_symbol @R'program@@@z!t@@@@@@PniiQni@@tQ@@6might_raise_static_exn @i%named@@@@0Static_exception!t@@@@@@@@@@@orpr5@@R@@0make_closure_map @'program@@@#Map!t2Set_of_closures_id!t@@@@@@@@@vx@@S@@4all_lifted_constants @'program@@@Ƞ@!t@@@@7constant_defining_value@@@@@@@@@@@|~@@T@@;all_lifted_constants_as_map @'program@@@#Map!t7constant_defining_value@@@@@@@@@99n@@U@@ $all_lifted_constant_sets_of_closures@'program@@@c#Set!t@@@@@@**h@@V@@s-Stdlib__Uchar056uf4[_+Stdlib__Sys0 -ռ鱦s5/.Stdlib__String0Vê>)Longident0s `7mɕc(Location0a7cK_H%9)Load_path0I@18 ~,Linkage_name0EwKсڊs&Lambda0z1x]&ZT7Internal_variable_names0HdeՄL ԩ,Identifiable0 {d\FX'`%Ident0">WA+9*X*Format_doc0]mWϓ:Mݠ'Flambda0Idvu "#Env0zV L{YWI)Debuginfo0PtJ=^w/*Data_types0I'Ue`wq]Ѡ0Compilation_unit0 {p-Vg_*Cmi_format0c˯7͗ԩmݠ.Closure_origin0vˆtT{(}z*Closure_id05:z[ކ/Closure_element0YWZ̡Q.hV&2Clambda_primitives01U10CamlinternalLazy0&͂7 Pˆ8CamlinternalFormatBasics0%FU(Q/Tu5Build_path_prefix_map0z HkGs(Asttypes0>n{T8cئ/Allocated_const0ЖݔTW@@@Caml1999T0371ZT*C-Flambda_utils-ocaml.warning $middle_end/flambda/flambda_utils.mliQQ@2+a-4-9-30-40-41-42 QQ@@QQ@@@@@@QQ@3@@@@@@#intA;@@@A@@@@@&_none_@@A@A@$charB;@@A@@@@@@A@&stringQ;@@ A@@@@@ @@@%bytesC;@@A@@@@@@@@%floatD;@@A@@@@@@@@$boolE;@@%falsec@@@$trued@@#@@@A@@@@@$@A@$unitF;@@"()e@@.@@@A@@@@@/@A@ #exnG;@@@A@@@@@3@@@#effH;@@O@A@A@@@@@@<@@@,continuationI;@@Q@@P@B@A@nY@@@@@@K@@@%arrayJ;@@R@A@A@@@@@@U@@@ $listK;@@S@A"[]f@@b@"::g@@@T@@o@ @@A@Y@@@@@r@@@&optionL;@@V@A$Noneh@@@$Somei@@@@@A@Y@@@@@@@@)nativeintM;@@A@@@@@@@@%int32N;@@A@@@@@@@@%int64O;@@A@@@@@@@@&lazy_tP;@@X@AJA@Y@@@@@@@@5extension_constructorR;@@A@@@@@@@@*floatarrayS;@@A@@@@@@@@&iarrayT;@@Y@A[A@Y@@@@@@@@*atomic_locU;@@Z@AdA@@@@@@@@@.Assert_failure`#@@@@@J@@@@@@@@[@@AϠ=ocaml.warn_on_literal_patternӐ@@0Division_by_zero]#@@@A٠  @+End_of_file\#$@@@Aᠰ@'FailureY#,@'@@A꠰@0Invalid_argumentX#5@0@@A󠰠$#@-Match_failureV#>@@=@9@;@@a@@A54@)Not_foundZ#O@@@A =<@-Out_of_memoryW#W@@@AED@.Stack_overflow^#_@@@AML@.Sys_blocked_io_#g@@@A$U'T'@)Sys_error[#o@j@@A-^0]0@:Undefined_recursive_modulea#x@@w@s@u@@h@@A>oAnA@:Continuation_already_takenb#@@@AFwIvI@&Stdlib@Azy@*ocaml.textT : Utility functions for the Flambda intermediate language. SS@@@@@@e2 Access functions UU@@@@@@0find_declarationhXTXXTh@б@г*Closure_id!t*Closure_idYkmYkw@ YkxYky@@@@@@ @@б@г'Flambda5function_declarations'FlambdaYk}Yk@ YkYk@@@@@@ ذ @@г4function_declaration'FlambdaYkYk@ YkYk@@@@@@  @@@@@ $ @@@9@@ A @@@ XTT@)ocaml.docҐ G [find_declaration f decl] raises [Not_found] if [f] is not in [decl]. WWS@@@@@@@)@@@!@㐠@@@@@@9find_declaration_variable3]4]3@б@гz!t*Closure_idB^68C^6B@ F^6CG^6D@@@@@@ 365566666@5C@A @@б@гz5function_declarations'Flambda\^6H]^6O@ `^6Pa^6e@@@@@@  @@г(Variable!t(Variablet^6iu^6q@ x^6ry^6s@@@@@@ 2 @@@@@ 5& @@@;@@ 8C @@@]@z T [find_declaration_variable f decl] raises [Not_found] if [f] is not in [decl]. [\@@@@@@@A@@@[@@@@@@W2find_free_variableaa@б@г2Var_within_closure!t2Var_within_closurebb@ bb@@@@@@ 3@{C@A @@б@г/set_of_closures'Flambdabb@ bb@@@@@@  @@гz!t(Variablebb@ bb@@@@@@ 0 @@@@@ 3$ @@@9@@ 6A @@@a@򐠠 I [find_free_variable v clos] raises [Not_found] if [c] is not in [clos].  `uu `u@@@@@@@B@@@Ӑ@@@@@@U3 Utility functions *d+d6@@@@@@3@g1@A.function_arity6f8<7f8J@б@гc4function_declaration'FlambdaEf8MFf8T@ If8UJf8i@@@@@@ # @@г#intWf8mXf8p@@ @@@ 0@@@@@ 3@@@bf88 @@nC@@ @@9>variables_bound_by_the_closureƠmp ? Cnp ? a@б@г!t*Closure_id|q d f}q d p@ q d qq d r@@@@@@ 3pooppppp@[V(@A @@б@г5function_declarations'Flambdaq d vq d }@ q d ~q d @@@@@@  @@г;#Set!t(Variableq d q d @ q d q d @@q d q d @ @@@@@ 9@@@%@@ <- @@@B@@ ?J @@@p ? ?@  Variables "bound by a closure" are those variables free in the corresponding function's body that are neither: - bound as parameters of that function; nor - bound by the [let] binding that introduces the function declaration(s). In particular, if [f], [g] and [h] are being introduced by a simultaneous, possibly mutually-recursive [let] binding then none of [f], [g] or [h] are bound in any of the closures for [f], [g] and [h]. hrro < >@@@@@@@D@@@@@@@@@^-can_be_mergedǠu  u  %@б@г!t'Flambdau  (u  /@ u  0u  1@@@@@@ 3@A@A @@б@г3!t'Flambdau  5u  <@ u  =u  >@@@@@@  @@гϠ$bool'u  B(u  F@@ @@@ '@@@@@ *@@@0@@ -8 @@@5u  @( g If [can_be_merged f1 f2] is [true], it is safe to merge switch branches containing [f1] and [f2]. Bs  Ct  @@@@@@@OE@@@8 @@@@@@LDb>K@ b>Lb>M@@@@@@0 @@@@@3$ @@M9@@6` @@@_@@L@@@@=2initialize_symbolsdOSdOe@б@г'program'Flambdaefkefr@ efsefz@@@@@@ 3@_(@A @@г/$listf{f{@В@г&Symbol!t&Symbolf{f{@ f{f{@@@@@@( @@@г#Tag!t#Tagf{f{@ f{f{@@@@@@B @@@гq$list f{ f{@г7!t'Flambdaf{f{@ f{f{@@@@@@d @@@ @@@i@@@@I@1@ @@rU&@@@p @@@w7f{n@@@~@@{q@@@=dOOt@@IM@@v@@0imported_symbolsHhIh@б@гu'program'FlambdaWhXh@ [h\h@@@@@@3KJJKKKKK@(@A @@г#Set!t&Symbolshth@ whxh@@|h}h@ @@@@@!@@@'@@$/ @@@h @@N@@@@*5needed_import_symbolsjj@б@г'program'Flambdajj@ jj @@@@@@3@Lj(@A @@г#Set!t&Symboljj@ jj@@jj@ @@@@@!@@@'@@$/ @@@j @@O@@@@*?introduce_needed_import_symbolsl#lB@б@г 'program'FlambdalElL@ lMlT@@@@@@3@Lj(@A @@г#'program'Flambda lX l_@  l` lg@@@@@@ @@@@@& @@@ l @@ !P@@@@!+root_symbol nim !nix@б@гM'program'Flambda /ni{ 0ni@  3ni 4ni@@@@@@3 # " " # # # # #@Ca(@A @@гl!t&Symbol Gni Hni@  Kni Lni@@@@@@ @@@@@& @@@ Wnii @@ cQ@@@@!6might_raise_static_exnŠ br cr@б@г%named'Flambda qr  rr@  ur vr@@@@@@3 e d d e e e e e@Ca(@A @@б@г0Static_exception!t0Static_exception r r+@  r, r-@@@@@@ @@г G$bool r1 r5@@ @@@)@@@@@,@@@2@@/: @@@ r@ O Returns [true] iff the given term might raise the given static exception.  p q@@@@@@@ R@@@ @@@@@@N0make_closure_map  v v@б@г'program'Flambda w w@  w w@@@@@@3        @pA@A @@г1#Map!t*Closure_id x x@  x x@@ x x@ @г2Set_of_closures_id!t2Set_of_closures_id x x@  x x@@@@@@T6 @@@4@@@V; @@@A@@W>I#@@@ +v&@ w Creates a map from closure IDs to set_of_closure IDs by iterating over all sets of closures in the given program.  8t77 9u@@@@@@@ ES@@6@. @@@@@@]4all_lifted_constants  O| P|@б@г|'program'Flambda ^} _}@  b} c}@@@@@@X3 R Q Q R R R R R@A@A @@г ؠ$list r~ s~@В@г!t&Symbol ~ ~@  ~ ~@@@@@@Y& @@@г7constant_defining_value'Flambda ~ ~@  ~ ~@@@@@@Z> @@@@ @ @@[E* @@@C @@@]J ~A@@@Q@@^NYD@@@ |G@ s The definitions of all constants that have been lifted out to [Let_symbol] or [Let_rec_symbol] constructions.  z   {Y@@@@@@@ T@@W@ @@@@@@m;all_lifted_constants_as_mapG 9= 9X@б@г 'program'Flambda Y^ Ye@  Yf Ym@@@@@@_3        @A@A @@г*#Map!t&Symbol n n@  n n@@ n n@ @г >7constant_defining_value'Flambda ns !nz@  $n{ %n@@@@@@i4 @@@2@@@k9@@@?@@l<G!@@@ 599$@ ( J Like [all_lifted_constant_symbols], but returns a map instead of a list.  B C8@@@@@@@ OU@@4@ 8 @@@@@@[ $all_lifted_constant_sets_of_closuresx Y*. Z*R@б@г 'program'Flambda hSX iS_@  lS` mSg@@@@@@m3 \ [ [ \ \ \ \ \@}A@A @@гm#Set!t2Set_of_closures_id hm h@  h h@@ h h@ @@@@@O!@@@'@@P$/ @@@ ** @ The identifiers of all constant sets of closures that have been lifted out to [Let_symbol] or [Let_rec_symbol] constructions.   )@@@@@@@ V@@@  m@@@@@@C(m@@@@@@6" @@@ @@@8'@@@-@@9*5 @@@ N((#@ A S All sets of closures in the given program (whether or not bound to a symbol.)  [ \'@@@@@@@ hX@@3@ Q "@@@@@@I8all_sets_of_closures_map rtx st@б@г 'program'Flambda  @   @@@@@@:3 u t t u u u u u@kA@A @@г#Map!t2Set_of_closures_id  @   @@  @ @г /set_of_closures'Flambda  @   @@@@@@!D4 @@@2@@@!F9@@@?@@!G<G!@@@ tt$@@ Y@@&@@B *substitute_read_symbol_field_for_variables  @б@г s#Map!t(Variable  @   @@  @ @В@г)!t&Symbol  @   @@@@@@!H3        @H@A @@@г $list  @г 䠐#int $ %@@ @@@!I@@@@@@!K  @@@@(@ @@!L'2@@@] @@@!N, ;J@@б@г g!t'Flambda I J@  M N@@@@@@!OE @@г }!t'Flambda _ `@  c d@@@@@@!P[ @@@@@!Q^$ @@@9@@!Ra5 @@@ r@@ ~Z@@@@g-Switch_storerA .5 .B@ \@@Б(mk_store IO IW@б@г /$unit IZ I^@@ @@@!S3        @/@A@@г&Switch't_store&Switch It Iz@  I{ I@@г !t'Flambda Ic Ij@  Ik Il@@@@@@!s- @@г j$unit In Ir@@ @@@!t;@@@9@@@!wA Ib.@@@H @@!xEK1@@@ IK4@@ [@@6@@K@a@@3        @Nc @A3        @P@A .E @@  + For the compilation of switch statements.   -@@@@@@@..@@!t*Closure_id@   @@@@@@! @@гA!t&Symbol@  !@@@@@@!4 @@@@@!7$ @@б@г U5function_declarations'Flambda78 @ ;<#@@@@@@!O @@г #Set!t(VariableQ$)R$1@ U$2V$5@@Z$6[$7@ @@@@@!n@@@%@@!q- @@o?@@!tg @@{@@!xk@@@n@ a q Computes the set of closure_id in the set of closures that are required used (transitively) the entry_point {|[@@@@@@@^@@$@ qB@@@@@@8all_functions_parameters9=9U@б@г 5function_declarations'Flambda9X9_@ 9`9u@@@@@@!3@A@A @@г H#Set!t(Variable9y9@ 99@@99@ @@@@@!!@@@'@@!$/ @@@99 @@_@@@@*0all_free_symbols@б@г 5function_declarations'Flambda@ @@@@@@!3@Lj(@A @@г*#Set!t&Symbol @   @@@ @@@@@!!@@@'@@!$/ @@@ @@)`@@@@*-contains_stub()@б@гU5function_declarations'Flambda78@ ;<@@@@@@!3+**+++++@Lj(@A @@г$boolKL@@ @@@!@@@@@!@@@V @@ba@@ @@1clean_projectionsab@б/which_variablesг#Map!t(Variablevw@ z{@@@ @г.specialised_to'Flambda@ @@@@@@!3@XvF@A @@@4 @@@! @@г:#Map!t(Variable@ !@@"#@ @г.specialised_to'Flambda@ @@@@@@!9 @@@2@@@!>@@t>@@!A"@@@%@@b@@'@@H3projection_to_named%)%<@б@г*Projection!t*Projection%?%I@ %J%K@@@@@@"73@l*@A @@г/%named'Flambda%O%V@ %W%\@@@@@@"8 @@@@@"9& @@@!%% @@-c@@@@!A+6specialised_to_same_asB-^c.^y@@;@@/Not_specialised@@7|~8|@@De@:Specialised_and_aliased_to#Set!t@@@":@@IJ@@Vf@@@A@@@@@M^^@@@@Yd@@#T|@@@@ @#Z[@@г(Variablehi@&lm@@*q(@ )@@33]\\]]]]]@rWM;@@@A@@@@@,@@@*@A/@@@@1@@A@-@@3cbbccccc@@A.1@ +parameters_specialised_to_the_same_variable!6!:!6!e@б.function_declsг5function_declarations'Flambda!f!z!f!@ !f!!f!@@@@@@(z3@+wq@A @@б0specialised_argsг?#Map!t(Variable!!!!@ !!!!@@!!!!@ @г.specialised_to'Flambda!!!!@ !!!!@@@@@@({8 @@@2@@@(}=@@гv#Map!t(Variable!!!!@ !!!"@@!"!"@ @гe$list!!!!@гܠ6specialised_to_same_as !! !!@@ @@@(~p@@@@@@(u @@@8@@@(z$@@xD@@(}!!(@@@@( !f!k,@@@#!6!6/@ n For each parameter in a given set of function declarations and the usual specialised-args mapping, determine which other parameters are specialised to the same variable as that parameter. The result is presented as a map from [fun_vars] to lists, corresponding componentwise to the usual [params] list in the corresponding function declaration. 01!"!5@@@@@@@=g@@?@&@@@@@@@6@@H@@@c@  @  #@  @  +@ $ @ w @  @  @  @  @  N@ G @ @>@@8@@t@m%@@@@Nx@@s@@@e@^.@'@g@_YA@ i@@3tssttttt@ k@A@ H************************************************************************A@@A@L@ H BMMBM@ H OCaml CC@ H DD3@ H Pierre Chambart, OCamlPro E44E4@ H Mark Shinwell and Leo White, Jane Street Europe FF@ H GG@ H Copyright 2013--2016 OCamlPro SAS HHg@ H Copyright 2014--2016 Jane Street Group LLC IhhIh@ H JJ@ H All rights reserved. This file is distributed under the terms of KKN@ H the GNU Lesser General Public License version 2.1, with the LOOLO@ H special exception on linking described in the file LICENSE. MM@ H NN5@ H************************************************************************O66O6@ ;* Utility functions for the Flambda intermediate language. L3* Access functions > H* [find_declaration f decl] raises [Not_found] if [f] is not in [decl]. Ԡ U* [find_declaration_variable f decl] raises [Not_found] if [f] is not in [decl]. _ J* [find_free_variable v clos] raises [Not_found] if [c] is not in [clos]. ꠠ4* Utility functions Ϡ * Variables "bound by a closure" are those variables free in the corresponding function's body that are neither: - bound as parameters of that function; nor - bound by the [let] binding that introduces the function declaration(s). In particular, if [f], [g] and [h] are being introduced by a simultaneous, possibly mutually-recursive [let] binding then none of [f], [g] or [h] are bound in any of the closures for [f], [g] and [h]. ' h* If [can_be_merged f1 f2] is [true], it is safe to merge switch branches containing [f1] and [f2].  C Given an expression, freshen all variables within it, and form a function whose body is the resulting expression. The variables specified by [params] will become the parameters of the function; the closure will be identified by [id]. [params] must only reference variables that are free variables of [body]. y  }  @ CR-soon mshinwell: consider improving name and names of arguments lwhite: the params restriction seems odd, perhaps give a reason in the comment. ~   @ P e@ * [bind [var1, expr1; ...; varN, exprN] body] binds using [Immutable] [Let] expressions the given [(var, expr)] pairs around the body.  A P* Returns [true] iff the given term might raise the given static exception.  W x* Creates a map from closure IDs to set_of_closure IDs by iterating over all sets of closures in the given program. ܠ t* The definitions of all constants that have been lifted out to [Let_symbol] or [Let_rec_symbol] constructions. Q K* Like [all_lifted_constant_symbols], but returns a map instead of a list. ؠ * The identifiers of all constant sets of closures that have been lifted out to [Let_symbol] or [Let_rec_symbol] constructions. w T* All sets of closures in the given program (whether or not bound to a symbol.) Š CR-someday pchambart: A more general version of this function might take a [named] instead of a symbol and be called with [Read_symbol_field (symbol, 0)]. #$^@ ,* For the compilation of switch statements. + * Within a set of function declarations there is a set of function bodies, each of which may (or may not) reference one of the other functions in the same set. Initially such intra-set references are by [Var]s (known as "fun_var"s) but if the function is lifted by [Lift_constants] then the references will be translated to [Symbol]s. This means that optimization passes that need to identify whether a given "fun_var" (i.e. a key in the [funs] map in a value of type [function_declarations]) is used in one of the function bodies need to examine the [free_symbols] as well as the [free_variables] members of [function_declarations]. This function makes that process easier by computing all used "fun_var"s in the bodies of the given set of function declarations, including the cases where the references are [Symbol]s. The returned value is a map from "fun_var"s to the "fun_var"s (if any) used in the body of the function associated with that "fun_var". l r* Computes the set of closure_id in the set of closures that are required used (transitively) the entry_point  Ensure that projection information is suitably erased from free_vars and specialised_args if we have deleted the variable being projected from. 2  3@ o* For each parameter in a given set of function declarations and the usual specialised-args mapping, determine which other parameters are specialised to the same variable as that parameter. The result is presented as a map from [fun_vars] to lists, corresponding componentwise to the usual [params] list in the corresponding function declaration. @-./boot/ocamlc)-nostdlib"-I&./boot*-use-prims2runtime/primitives"-g0-strict-sequence*-principal(-absname"-w8+a-4-9-40-41-42-44-45-48+-warn-error"+a*-bin-annot/-strict-formats"-I2middle_end/flambda"-I%utils"-I'parsing"-I&typing"-I(bytecomp"-I,file_formats"-I&lambda"-I*middle_end"-I2middle_end/closure"-I2middle_end/flambda"-I=middle_end/flambda/base_types"-I'asmcomp"-I&driver"-I(toplevel"-I%tools"-I'runtime"-I1otherlibs/dynlink"-I-otherlibs/str"-I4otherlibs/systhreads"-I.otherlibs/unix"-I8otherlibs/runtime_events"-crs =/builds/workspace/precheck/flambda/false/label/ocaml-linux-32 >10/.-,+*)('&%$#"! @@0M Ź 6%#Hb3zyyzzzzz@x@@/Allocated_const0ЖݔTWŠ(Asttypes0>n{T8cئ5Build_path_prefix_map0z HkGs8CamlinternalFormatBasics0%FU(Q/Tu0CamlinternalLazy0&͂7 Pˆ2Clambda_primitives01U1/Closure_element0YWZ̡Q.hV&05:z[ކ.Closure_origin0vˆtT{(}z*Cmi_format0c˯7͗ԩmݠ0Compilation_unit0 {p-Vg_*Data_types0I'Ue`wq]Ѡ)Debuginfo0PtJ=^w/#Env0zV L{YWI0Idvu "0%#, s*Format_doc0]mWϓ:Mݠ%Ident0">WA+9*X,Identifiable0 {d\FX'`7Internal_variable_names0HdeՄL ԩ&Lambda0z1x]&ZT,Linkage_name0EwKсڊs)Load_path0I@18 ~(Location0a7cK_H%9)Longident0s `7mɕc$Misc0ob]6>Vê>0Mutable_variable0~emPs0ܨnm\7&Symbol0ҡ4d,#Tag0\݅}x.Type_immediacy0A^abOhՠ%Types0^Y~# )Unit_info0ڀh%(2Var_within_closure00SSJh6 (Variable0' Gr㠠(Warnings0mJɒkgr@@p@@z c ֐PV@ | ð ː)@ Ő 2@@@>@D{@@@  =@@ ِ w@ t@=F@ W @? { @ i @@P@@