diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-01-05 15:59:22 -0500 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-01-05 15:59:22 -0500 |
commit | 2bbff83d4026c1c97e9b881266478b4398455814 (patch) | |
tree | 76f5f21eb5416ca2a1512d5b38d2da4f31e20d32 /lo.ml | |
parent | 85ffed1369f526d23a538085bb1ac6318835e9a3 (diff) | |
download | roux-2bbff83d4026c1c97e9b881266478b4398455814.tar.gz |
quick fix in loc2 for constants
Diffstat (limited to 'lo.ml')
-rw-r--r-- | lo.ml | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lo.ml b/lo.ml index 0f50c97..369a66d 100644 --- a/lo.ml +++ b/lo.ml @@ -176,8 +176,14 @@ let regalloc nr p l = let loc2 i = try List.assoc i !locs with Not_found -> - if free () = [] then LSpl (setspill i) - else LReg (alloc hints.(i) i) in + match p.(i) with + | ICon k -> setloc i (LCon k); LCon k + | _ -> + (* Here, we just want to avoid using the + same register we used for the first + operand. *) + if free () = [] then LSpl (setspill i) + else LReg (alloc hints.(i) i) in (* Find a register for a destination. *) let dst i = |