aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Linearizeaux.ml
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-04-20 07:54:52 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-04-20 07:54:52 +0000
commit255cee09b71255051c2b40eae0c88bffce1f6f32 (patch)
tree7951b1b13e8fd5e525b9223e8be0580e83550f55 /backend/Linearizeaux.ml
parent6e5041958df01c56762e90770abd704b95a36e5d (diff)
downloadcompcert-kvx-255cee09b71255051c2b40eae0c88bffce1f6f32.tar.gz
compcert-kvx-255cee09b71255051c2b40eae0c88bffce1f6f32.zip
Big merge of the newregalloc-int64 branch. Lots of changes in two directions:
1- new register allocator (+ live range splitting, spilling&reloading, etc) based on a posteriori validation using the Rideau-Leroy algorithm 2- support for 64-bit integer arithmetic (type "long long"). git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2200 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'backend/Linearizeaux.ml')
-rw-r--r--backend/Linearizeaux.ml28
1 files changed, 15 insertions, 13 deletions
diff --git a/backend/Linearizeaux.ml b/backend/Linearizeaux.ml
index ac47ae89..5bb5838e 100644
--- a/backend/Linearizeaux.ml
+++ b/backend/Linearizeaux.ml
@@ -47,8 +47,12 @@ let join_points f =
reached_twice := IntSet.add npc !reached_twice
end else begin
reached := IntSet.add npc !reached;
- List.iter traverse (Kildall.successors_list succs pc)
+ traverse_succs (Kildall.successors_list succs pc)
end
+ and traverse_succs = function
+ | [] -> ()
+ | [pc] -> traverse pc
+ | pc :: l -> traverse pc; traverse_succs l
in traverse f.fn_entrypoint; !reached_twice
(* Cut into reachable basic blocks, annotated with the min value of the PC *)
@@ -73,20 +77,18 @@ let basic_blocks f joins =
let minpc = min npc minpc in
match PTree.get pc f.fn_code with
| None -> assert false
- | Some i ->
- match i with
- | Lnop s -> next_in_block blk minpc s
- | Lop (op, args, res, s) -> next_in_block blk minpc s
- | Lload (chunk, addr, args, dst, s) -> next_in_block blk minpc s
- | Lstore (chunk, addr, args, src, s) -> next_in_block blk minpc s
- | Lcall (sig0, ros, args, res, s) -> next_in_block blk minpc s
- | Ltailcall (sig0, ros, args) -> end_block blk minpc
- | Lbuiltin (ef, args, res, s) -> next_in_block blk minpc s
- | Lcond (cond, args, ifso, ifnot) ->
+ | Some b ->
+ let rec do_instr_list = function
+ | [] -> assert false
+ | Lbranch s :: _ -> next_in_block blk minpc s
+ | Ltailcall (sig0, ros) :: _ -> end_block blk minpc
+ | Lcond (cond, args, ifso, ifnot) :: _ ->
end_block blk minpc; start_block ifso; start_block ifnot
- | Ljumptable(arg, tbl) ->
+ | Ljumptable(arg, tbl) :: _ ->
end_block blk minpc; List.iter start_block tbl
- | Lreturn optarg -> end_block blk minpc
+ | Lreturn :: _ -> end_block blk minpc
+ | instr :: b' -> do_instr_list b' in
+ do_instr_list b
(* next_in_block: check if join point and either extend block
or start block *)
and next_in_block blk minpc pc =