Skip to content

Commit

Permalink
Register allocation: minor improvement
Browse files Browse the repository at this point in the history
The optimization that conflicts between variables allocated to disjoint
banks can be ignored is now applied only to variables of “reg” kind.
  • Loading branch information
vbgl authored and bgregoir committed Jun 10, 2024
1 parent a7c5db0 commit 5249c4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/regalloc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,14 @@ let conflicts_in (i: Sv.t) (k: var -> var -> 'a -> 'a) : 'a -> 'a =
fun a -> loop a e

let conflicts_add_one pd reg_size asmOp tbl tr loc (v: var) (w: var) (c: conflicts) : conflicts =
if types_cannot_conflict reg_size v.v_kind v.v_ty w.v_kind w.v_ty then c else
try
let i = Hv.find tbl v in
let j = Hv.find tbl w in
if i = j then hierror_reg ~loc:loc "conflicting variables “%a” and “%a” must be merged due to:@;<1 2>%a"
(Printer.pp_var ~debug:true) v
(Printer.pp_var ~debug:true) w
(pp_trace pd asmOp i) tr;
if types_cannot_conflict reg_size v.v_kind v.v_ty w.v_kind w.v_ty then c else
c |> add_conflicts i j |> add_conflicts j i
with Not_found -> c

Expand Down

0 comments on commit 5249c4e

Please sign in to comment.