X-Git-Url: http://git.joshuawise.com/snipe.git/blobdiff_plain/12aa4087bee3e70f170d7457794921de4e385227..0a24e44d4e9f82f8d3d83de8e58c83c8cf2868b6:/codegen/peephole.sml diff --git a/codegen/peephole.sml b/codegen/peephole.sml index cdbba9c..7880a45 100644 --- a/codegen/peephole.sml +++ b/codegen/peephole.sml @@ -1,5 +1,5 @@ -(* peephole optimizer - * Gathers tiberium, fires rockets +(* L2 compiler + * peephole optimizer * optimizes away redundant insns such as: mov a, b mov a, b @@ -11,23 +11,19 @@ neg a neg a - * Author: Chris Lu + * Author: Chris Lu *) signature PEEPHOLE = sig - type tiberium = x86.insn list - type rockets = x86.insn list - val peephole : tiberium -> rockets + val peephole : x86.insn list -> x86.insn list end structure Peephole :> PEEPHOLE = struct - type tiberium = x86.insn list - type rockets = x86.insn list structure X = x86 - (* val peephole : tiberium -> rockets *) + (* val peephole : x86.insn list -> x86.insn list *) fun peephole ((insn1 as X.MOVL(a1,b1))::(insn2 as X.MOVL(a2,b2))::l) = if(x86.opereq(a1, b1) orelse (x86.opereq(a1, a2) andalso x86.opereq(b1, b2))) then