1
1
[@@@ ocaml.warning " +a-4-30-40-41-42-69" ]
2
2
3
3
open ! Int_replace_polymorphic_compare
4
- module Instr = Numbers. Int
5
4
module DLL = Flambda_backend_utils. Doubly_linked_list
6
5
7
6
module type Transfer_domain_S = sig
@@ -33,7 +32,7 @@ module type Dataflow_direction_S = sig
33
32
type context
34
33
35
34
val transfer_block :
36
- update_instr :(int -> instr_domain -> unit ) ->
35
+ update_instr :(InstructionId . t -> instr_domain -> unit ) ->
37
36
Transfer_domain .t ->
38
37
Cfg .basic_block ->
39
38
context ->
@@ -57,7 +56,7 @@ module type Dataflow_S = sig
57
56
58
57
val get_res_block : work_state -> Transfer_domain .t Label.Tbl .t
59
58
60
- val get_res_instr_exn : work_state -> instr_domain Instr .Tbl.t
59
+ val get_res_instr_exn : work_state -> instr_domain InstructionId .Tbl.t
61
60
62
61
val run : max_iteration :int -> work_state -> context -> (unit , unit ) Result .t
63
62
end
@@ -123,7 +122,7 @@ module Make_dataflow (D : Dataflow_direction_S) :
123
122
{ cfg : Cfg .t ;
124
123
mutable queue : WorkSet .t ;
125
124
map_block : Transfer_domain .t Label.Tbl .t ;
126
- map_instr : D .instr_domain Instr .Tbl.t option
125
+ map_instr : D .instr_domain InstructionId .Tbl.t option
127
126
}
128
127
129
128
type instr_domain = D .instr_domain
@@ -197,11 +196,11 @@ module Make_dataflow (D : Dataflow_direction_S) :
197
196
assert (Label.Tbl. length priorities = Label.Tbl. length cfg.blocks);
198
197
priorities
199
198
200
- let update_instr : work_state -> int -> instr_domain -> unit =
199
+ let update_instr : work_state -> InstructionId.t -> instr_domain -> unit =
201
200
fun t instr_id value ->
202
201
match t.map_instr with
203
202
| None -> ()
204
- | Some map_instr -> Instr .Tbl. replace map_instr instr_id value
203
+ | Some map_instr -> InstructionId .Tbl. replace map_instr instr_id value
205
204
206
205
let create :
207
206
Cfg. t ->
@@ -217,7 +216,7 @@ module Make_dataflow (D : Dataflow_direction_S) :
217
216
then
218
217
let map_instr =
219
218
(* CR-soon xclerc for xclerc: review the `16` constant. *)
220
- Instr .Tbl. create (Label.Tbl. length cfg.Cfg. blocks * 16 )
219
+ InstructionId .Tbl. create (Label.Tbl. length cfg.Cfg. blocks * 16 )
221
220
in
222
221
Some map_instr
223
222
else None
@@ -345,7 +344,7 @@ module Forward (D : Domain_S) (T : Forward_transfer with type domain = D.t) :
345
344
type context = T .context
346
345
347
346
let transfer_block :
348
- update_instr :(int -> instr_domain -> unit ) ->
347
+ update_instr :(InstructionId. t -> instr_domain -> unit ) ->
349
348
Transfer_domain. t ->
350
349
Cfg. basic_block ->
351
350
context ->
@@ -426,8 +425,8 @@ module type Backward_S = sig
426
425
427
426
type _ map =
428
427
| Block : domain Label.Tbl .t map
429
- | Instr : domain Instr .Tbl.t map
430
- | Both : (domain Instr .Tbl.t * domain Label.Tbl .t ) map
428
+ | Instr : domain InstructionId .Tbl.t map
429
+ | Both : (domain InstructionId .Tbl.t * domain Label.Tbl .t ) map
431
430
432
431
val run :
433
432
Cfg .t ->
@@ -497,7 +496,7 @@ module Backward (D : Domain_S) (T : Backward_transfer with type domain = D.t) :
497
496
type context = T .context
498
497
499
498
let transfer_block :
500
- update_instr :(int -> instr_domain -> unit ) ->
499
+ update_instr :(InstructionId. t -> instr_domain -> unit ) ->
501
500
Transfer_domain. t ->
502
501
Cfg. basic_block ->
503
502
context ->
@@ -532,8 +531,8 @@ module Backward (D : Domain_S) (T : Backward_transfer with type domain = D.t) :
532
531
533
532
type _ map =
534
533
| Block : domain Label.Tbl .t map
535
- | Instr : domain Instr .Tbl.t map
536
- | Both : (domain Instr .Tbl.t * domain Label.Tbl .t ) map
534
+ | Instr : domain InstructionId .Tbl.t map
535
+ | Both : (domain InstructionId .Tbl.t * domain Label.Tbl .t ) map
537
536
538
537
let run :
539
538
type a .
0 commit comments