mirror of
git://c9x.me/qbe.git
synced 2026-04-05 18:09:47 +00:00
copy: consider identity element for more instructions
udiv %x, 1 == %x, and for each of sub, or, xor, sar, shr, and shl, <op> %x, 0 == %x.
This commit is contained in:
parent
0437e97a1b
commit
2bbfcf61b3
8
copy.c
8
copy.c
@ -27,10 +27,16 @@ iscopy(Ins *i, Ref r, Fn *fn)
|
|||||||
case Ocopy:
|
case Ocopy:
|
||||||
return 1;
|
return 1;
|
||||||
case Omul:
|
case Omul:
|
||||||
return iscon(i->arg[1], 1, fn);
|
|
||||||
case Odiv:
|
case Odiv:
|
||||||
|
case Oudiv:
|
||||||
return iscon(i->arg[1], 1, fn);
|
return iscon(i->arg[1], 1, fn);
|
||||||
case Oadd:
|
case Oadd:
|
||||||
|
case Osub:
|
||||||
|
case Oor:
|
||||||
|
case Oxor:
|
||||||
|
case Osar:
|
||||||
|
case Oshl:
|
||||||
|
case Oshr:
|
||||||
return iscon(i->arg[1], 0, fn);
|
return iscon(i->arg[1], 0, fn);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user