@@ -937,10 +937,11 @@ type nullary_primitive =
937
937
| Begin_region
938
938
| Begin_try_region
939
939
| Enter_inlined_apply of { dbg : Inlined_debuginfo .t }
940
+ | Dls_get
940
941
941
942
let nullary_primitive_eligible_for_cse = function
942
943
| Invalid _ | Optimised_out _ | Probe_is_enabled _ | Begin_region
943
- | Begin_try_region | Enter_inlined_apply _ ->
944
+ | Begin_try_region | Enter_inlined_apply _ | Dls_get ->
944
945
false
945
946
946
947
let compare_nullary_primitive p1 p2 =
@@ -953,29 +954,35 @@ let compare_nullary_primitive p1 p2 =
953
954
| Begin_try_region , Begin_try_region -> 0
954
955
| Enter_inlined_apply { dbg = dbg1 } , Enter_inlined_apply { dbg = dbg2 } ->
955
956
Inlined_debuginfo. compare dbg1 dbg2
957
+ | Dls_get , Dls_get -> 0
956
958
| ( Invalid _,
957
959
( Optimised_out _ | Probe_is_enabled _ | Begin_region | Begin_try_region
958
- | Enter_inlined_apply _ ) ) ->
960
+ | Enter_inlined_apply _ | Dls_get ) ) ->
959
961
- 1
960
962
| ( Optimised_out _,
961
963
( Probe_is_enabled _ | Begin_region | Begin_try_region
962
- | Enter_inlined_apply _ ) ) ->
964
+ | Enter_inlined_apply _ | Dls_get ) ) ->
963
965
- 1
964
966
| Optimised_out _ , Invalid _ -> 1
965
- | Probe_is_enabled _, ( Begin_region | Begin_try_region | Enter_inlined_apply _)
966
- ->
967
+ | ( Probe_is_enabled _,
968
+ ( Begin_region | Begin_try_region | Enter_inlined_apply _ | Dls_get ) ) ->
967
969
- 1
968
970
| Probe_is_enabled _ , (Invalid _ | Optimised_out _ ) -> 1
969
- | Begin_region , (Begin_try_region | Enter_inlined_apply _ ) -> - 1
971
+ | Begin_region , (Begin_try_region | Enter_inlined_apply _ | Dls_get ) -> - 1
970
972
| Begin_region , (Invalid _ | Optimised_out _ | Probe_is_enabled _ ) -> 1
971
- | Begin_try_region , Enter_inlined_apply _ -> - 1
973
+ | Begin_try_region , ( Enter_inlined_apply _ | Dls_get ) -> - 1
972
974
| ( Begin_try_region ,
973
975
(Invalid _ | Optimised_out _ | Probe_is_enabled _ | Begin_region ) ) ->
974
976
1
975
977
| ( Enter_inlined_apply _,
976
978
( Invalid _ | Optimised_out _ | Probe_is_enabled _ | Begin_region
977
979
| Begin_try_region ) ) ->
978
980
1
981
+ | Enter_inlined_apply _ , Dls_get -> - 1
982
+ | ( Dls_get ,
983
+ ( Invalid _ | Optimised_out _ | Probe_is_enabled _ | Begin_region
984
+ | Begin_try_region | Enter_inlined_apply _ ) ) ->
985
+ 1
979
986
980
987
let equal_nullary_primitive p1 p2 = compare_nullary_primitive p1 p2 = 0
981
988
@@ -994,6 +1001,7 @@ let print_nullary_primitive ppf p =
994
1001
| Enter_inlined_apply { dbg } ->
995
1002
Format. fprintf ppf " @[<hov 1>(Enter_inlined_apply@ %a)@]"
996
1003
Inlined_debuginfo. print dbg
1004
+ | Dls_get -> Format. pp_print_string ppf " Dls_get"
997
1005
998
1006
let result_kind_of_nullary_primitive p : result_kind =
999
1007
match p with
@@ -1003,6 +1011,7 @@ let result_kind_of_nullary_primitive p : result_kind =
1003
1011
| Begin_region -> Singleton K. region
1004
1012
| Begin_try_region -> Singleton K. region
1005
1013
| Enter_inlined_apply _ -> Unit
1014
+ | Dls_get -> Singleton K. value
1006
1015
1007
1016
let coeffects_of_mode : Alloc_mode.For_allocations.t -> Coeffects.t = function
1008
1017
| Local _ -> Coeffects. Has_coeffects
@@ -1025,11 +1034,12 @@ let effects_and_coeffects_of_nullary_primitive p : Effects_and_coeffects.t =
1025
1034
(* This doesn't really have effects, but without effects, these primitives
1026
1035
get deleted during lambda_to_flambda. *)
1027
1036
Arbitrary_effects , Has_coeffects , Strict
1037
+ | Dls_get -> No_effects , Has_coeffects , Strict
1028
1038
1029
1039
let nullary_classify_for_printing p =
1030
1040
match p with
1031
1041
| Invalid _ | Optimised_out _ | Probe_is_enabled _ | Begin_region
1032
- | Begin_try_region | Enter_inlined_apply _ ->
1042
+ | Begin_try_region | Enter_inlined_apply _ | Dls_get ->
1033
1043
Neither
1034
1044
1035
1045
type unary_primitive =
@@ -2187,7 +2197,7 @@ let free_names t =
2187
2197
match t with
2188
2198
| Nullary
2189
2199
( Invalid _ | Optimised_out _ | Probe_is_enabled _ | Begin_region
2190
- | Begin_try_region | Enter_inlined_apply _ ) ->
2200
+ | Begin_try_region | Enter_inlined_apply _ | Dls_get ) ->
2191
2201
Name_occurrences. empty
2192
2202
| Unary (prim , x0 ) ->
2193
2203
Name_occurrences. union
@@ -2214,7 +2224,7 @@ let apply_renaming t renaming =
2214
2224
match t with
2215
2225
| Nullary
2216
2226
( Invalid _ | Optimised_out _ | Probe_is_enabled _ | Begin_region
2217
- | Begin_try_region | Enter_inlined_apply _ ) ->
2227
+ | Begin_try_region | Enter_inlined_apply _ | Dls_get ) ->
2218
2228
t
2219
2229
| Unary (prim , x0 ) ->
2220
2230
let prim' = apply_renaming_unary_primitive prim renaming in
@@ -2244,7 +2254,7 @@ let ids_for_export t =
2244
2254
match t with
2245
2255
| Nullary
2246
2256
( Invalid _ | Optimised_out _ | Probe_is_enabled _ | Begin_region
2247
- | Begin_try_region | Enter_inlined_apply _ ) ->
2257
+ | Begin_try_region | Enter_inlined_apply _ | Dls_get ) ->
2248
2258
Ids_for_export. empty
2249
2259
| Unary (prim , x0 ) ->
2250
2260
Ids_for_export. union
0 commit comments