X-Git-Url: http://git.joshuawise.com/snipe.git/blobdiff_plain/6ade8b0a3251e44b34c6bdbbd9403e36d6fd6231..1144856ba9d6018d9922c6ede7e97779a0fe6373:/codegen/liveness.sml diff --git a/codegen/liveness.sml b/codegen/liveness.sml index 24123b9..4c8e4ad 100644 --- a/codegen/liveness.sml +++ b/codegen/liveness.sml @@ -77,10 +77,14 @@ struct * helper functions to discard constant operands *) fun defhit (X.REG a) = [DEF(X.REG a)] | defhit (X.TEMP a) = [DEF(X.TEMP a)] + | defhit (X.REL(o1, o2)) = usehit o1 @ usehit o2 + | defhit (X.OSIZE(s, oo)) = defhit oo | defhit (_) = nil - fun usehit (X.REG a) = [USE(X.REG a)] + and usehit (X.REG a) = [USE(X.REG a)] | usehit (X.TEMP a) = [USE(X.TEMP a)] + | usehit (X.REL(o1, o2)) = usehit o1 @ usehit o2 + | usehit (X.OSIZE(s, oo)) = usehit oo | usehit (_) = nil fun callhit 0 = nil @@ -98,8 +102,8 @@ struct fun gendef (n, X.DIRECTIVE(_)) = (nil) | gendef (n, X.COMMENT(_)) = (nil) | gendef (n, X.LIVEIGN (_)) = ([SUCC (n+1)]) - | gendef (n, X.SIZE(_, i)) = gendef (n,i) | gendef (n, X.MOV(dest, src)) = (defhit dest @ usehit src @ [SUCC(n+1), ISMOVE]) + | gendef (n, X.LEA(dest, src)) = (defhit dest @ usehit src @ [SUCC(n+1)]) | gendef (n, X.SUB(dest, src)) = (defhit dest @ usehit dest @ usehit src @ [SUCC(n+1)]) | gendef (n, X.IMUL(dest, src)) = (defhit dest @ usehit dest @ usehit src @ [SUCC(n+1)]) | gendef (n, X.IMUL3(dest, src, _)) = (defhit dest @ usehit src @ [SUCC(n+1)])