summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-05-08 07:58:40 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-05-08 07:58:40 +0000
commite61e84579869cecd6ee0f4ac40d750eeedd6d80f (patch)
tree541e6459792cf54fdcdd13f76c2635af2b8ebb0f
parent884756b623fd6031a04102a545d92e4ec905f1cc (diff)
Add interferences at function entry with destroyed_at_function_entry.
Improve dead code elimination for Xparmove. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2241 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
-rw-r--r--backend/Regalloc.ml10
1 files changed, 8 insertions, 2 deletions
diff --git a/backend/Regalloc.ml b/backend/Regalloc.ml
index fe981e3..179b2cc 100644
--- a/backend/Regalloc.ml
+++ b/backend/Regalloc.ml
@@ -314,8 +314,11 @@ let dce_instr instr after k =
then instr :: k
else k
| Xparmove(srcs, dsts, itmp, ftmp) ->
- let (srcs', dsts') = dce_parmove srcs dsts after in
- Xparmove(srcs', dsts', itmp, ftmp) :: k
+ begin match dce_parmove srcs dsts after with
+ | ([], []) -> k
+ | ([src], [dst]) -> Xmove(src, dst) :: k
+ | (srcs', dsts') -> Xparmove(srcs', dsts', itmp, ftmp) :: k
+ end
| Xop(op, args, res) ->
if VSet.mem res after
then instr :: k
@@ -537,6 +540,9 @@ let find_coloring f liveness =
PTree.fold
(fun () pc blk -> ignore (add_interfs_block g blk (PMap.get pc liveness)))
f.fn_code ();
+ add_interfs_destroyed g
+ (transfer_live f f.fn_entrypoint (PMap.get f.fn_entrypoint liveness))
+ destroyed_at_function_entry;
IRC.coloring g