summaryrefslogtreecommitdiff
path: root/asmcomp/printmach.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2014-04-26 10:40:22 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2014-04-26 10:40:22 +0000
commit558f40e3446854913d5ce011441c4b10da03f27e (patch)
tree84c78a2d3098937813daae9bd75d328dc0669840 /asmcomp/printmach.ml
parent95d98cd9782c0577b0c7290f6535b29e7bd4cd41 (diff)
downloadocaml-558f40e3446854913d5ce011441c4b10da03f27e.tar.gz
New back-end optimization pass: common subexpression elimination (CSE).
(Reuses results of previous computations instead of recomputing them.) (Cherry-picked from branch backend-optim.) Tested on amd64/linux and i386/linux. Other back-ends compile (after assorted updates) but are untested. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14688 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmcomp/printmach.ml')
-rw-r--r--asmcomp/printmach.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/asmcomp/printmach.ml b/asmcomp/printmach.ml
index 0c577890d7..a39160d28c 100644
--- a/asmcomp/printmach.ml
+++ b/asmcomp/printmach.ml
@@ -119,12 +119,13 @@ let operation op arg ppf res =
| Iload(chunk, addr) ->
fprintf ppf "%s[%a]"
(Printcmm.chunk chunk) (Arch.print_addressing reg addr) arg
- | Istore(chunk, addr) ->
- fprintf ppf "%s[%a] := %a"
+ | Istore(chunk, addr, is_assign) ->
+ fprintf ppf "%s[%a] := %a %s"
(Printcmm.chunk chunk)
(Arch.print_addressing reg addr)
(Array.sub arg 1 (Array.length arg - 1))
reg arg.(0)
+ (if is_assign then "(assign)" else "(init)")
| Ialloc n -> fprintf ppf "alloc %i" n
| Iintop(op) -> fprintf ppf "%a%s%a" reg arg.(0) (intop op) reg arg.(1)
| Iintop_imm(op, n) -> fprintf ppf "%a%s%i" reg arg.(0) (intop op) n