From 2bbfcf61b38edfe3c347cd270380e5117454c0cf Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 6 Jul 2021 21:31:34 -0700 Subject: copy: consider identity element for more instructions udiv %x, 1 == %x, and for each of sub, or, xor, sar, shr, and shl, %x, 0 == %x. --- copy.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/copy.c b/copy.c index 053f319..593ce24 100644 --- a/copy.c +++ b/copy.c @@ -27,10 +27,16 @@ iscopy(Ins *i, Ref r, Fn *fn) case Ocopy: return 1; case Omul: - return iscon(i->arg[1], 1, fn); case Odiv: + case Oudiv: return iscon(i->arg[1], 1, fn); case Oadd: + case Osub: + case Oor: + case Oxor: + case Osar: + case Oshl: + case Oshr: return iscon(i->arg[1], 0, fn); default: break; -- cgit 1.4.1