* 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
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)])