From: Julian Seward Date: Mon, 4 Aug 2014 08:09:23 +0000 (+0000) Subject: Add a folding rule: XorV128(t,0) ==> t. X-Git-Tag: svn/VALGRIND_3_10_1^2~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa24828df02d410a78339a3df1a061e9932dcaee;p=thirdparty%2Fvalgrind.git Add a folding rule: XorV128(t,0) ==> t. git-svn-id: svn://svn.valgrind.org/vex/trunk@2912 --- diff --git a/VEX/priv/ir_opt.c b/VEX/priv/ir_opt.c index bc019dad6d..e2ad42d1df 100644 --- a/VEX/priv/ir_opt.c +++ b/VEX/priv/ir_opt.c @@ -2259,6 +2259,18 @@ static IRExpr* fold_Expr ( IRExpr** env, IRExpr* e ) e2 = mkZeroOfPrimopResultType(e->Iex.Binop.op); break; } + /* XorV128(t,0) ==> t */ + if (e->Iex.Binop.op == Iop_XorV128) { + if (isZeroV128(e->Iex.Binop.arg2)) { + e2 = e->Iex.Binop.arg1; + break; + } + //Disabled because there's no known test case right now. + //if (isZeroV128(e->Iex.Binop.arg1)) { + // e2 = e->Iex.Binop.arg2; + // break; + //} + } break; case Iop_CmpNE32: