@@ -190,11 +190,14 @@ let calculate_live_bitvectors
190
190
let n_quads = Array. length quads in
191
191
let n_vregs = cx.ctxt_n_vregs in
192
192
let new_bitv _ = Bits. create n_vregs false in
193
+ let new_true_bitv _ = Bits. create n_vregs true in
193
194
let (live_in_vregs:Bits.t array ) = Array. init n_quads new_bitv in
194
195
let (live_out_vregs:Bits.t array ) = Array. init n_quads new_bitv in
195
196
196
197
let (quad_used_vrs:Bits.t array ) = Array. init n_quads new_bitv in
197
- let (quad_defined_vrs:Bits.t array ) = Array. init n_quads new_bitv in
198
+ let (quad_not_defined_vrs:Bits.t array ) =
199
+ Array. init n_quads new_true_bitv
200
+ in
198
201
let (quad_uncond_jmp:bool array ) = Array. make n_quads false in
199
202
let (quad_jmp_targs:(Il.label list) array ) = Array. make n_quads [] in
200
203
@@ -212,8 +215,8 @@ let calculate_live_bitvectors
212
215
(fun v -> Bits. set quad_used_vrs.(i) v true )
213
216
(quad_used_vregs q);
214
217
List. iter
215
- (fun v -> Bits. set quad_defined_vrs .(i) v true )
216
- (quad_defined_vregs q)
218
+ (fun v -> Bits. set quad_not_defined_vrs .(i) v false )
219
+ (quad_defined_vregs q);
217
220
done ;
218
221
219
222
while ! changed do
@@ -228,7 +231,7 @@ let calculate_live_bitvectors
228
231
let live_in = live_in_vregs.(i) in
229
232
let live_out = live_out_vregs.(i) in
230
233
let used = quad_used_vrs.(i) in
231
- let defined = quad_defined_vrs .(i) in
234
+ let not_defined = quad_not_defined_vrs .(i) in
232
235
233
236
(* Union in the vregs we use. *)
234
237
note_change (Bits. union live_in used);
@@ -243,8 +246,7 @@ let calculate_live_bitvectors
243
246
then note_change (Bits. union live_out live_in_vregs.(i+ 1 ));
244
247
245
248
(* Propagate live-out to live-in on anything we don't define. *)
246
- ignore (Bits. copy scratch defined);
247
- Bits. invert scratch;
249
+ ignore (Bits. copy scratch not_defined);
248
250
ignore (Bits. intersect scratch live_out);
249
251
note_change (Bits. union live_in scratch);
250
252
@@ -379,8 +381,7 @@ let reg_alloc
379
381
let n_pre_spills = convert_pre_spills cx spill_slot in
380
382
381
383
let (live_in_vregs, live_out_vregs) =
382
- Session. time_inner " RA liveness" sess
383
- (fun _ -> calculate_live_bitvectors cx)
384
+ calculate_live_bitvectors cx
384
385
in
385
386
let (vreg_constraints:Bits.t array ) = (* vreg idx -> hreg bits.t *)
386
387
calculate_vreg_constraints cx
0 commit comments