From: Florian Krohm Date: Wed, 3 Sep 2025 15:09:50 +0000 (+0000) Subject: ir_opt.c: Algebraic simplification for Iop_Or1. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a7fe47937b088aff567f9de7c0a4275a6ca6e139;p=thirdparty%2Fvalgrind.git ir_opt.c: Algebraic simplification for Iop_Or1. Adapt function mkOnesOfPrimopResultType accordingly. --- diff --git a/VEX/priv/ir_opt.c b/VEX/priv/ir_opt.c index f38a7be64..1e4ba670e 100644 --- a/VEX/priv/ir_opt.c +++ b/VEX/priv/ir_opt.c @@ -1275,6 +1275,8 @@ static inline IRExpr* mkTrue(void) static IRExpr* mkOnesOfPrimopResultType ( IROp op ) { switch (op) { + case Iop_Or1: + return IRExpr_Const(IRConst_U1(0x1)); case Iop_Or8: return IRExpr_Const(IRConst_U8(0xFF)); case Iop_Or16: @@ -2599,23 +2601,24 @@ static IRExpr* fold_Expr_WRK ( IRExpr** env, IRExpr* e ) } break; + case Iop_Or1: case Iop_Or8: case Iop_Or16: case Iop_Or32: case Iop_Or64: case Iop_Max32U: - /* Or8/Or16/Or32/Or64/Max32U(x,0) ==> x */ + /* Or1/Or8/Or16/Or32/Or64/Max32U(x,0) ==> x */ if (isZeroU(e->Iex.Binop.arg2)) { e2 = e->Iex.Binop.arg1; break; } - /* Or8/Or16/Or32/Or64/Max32U(0,x) ==> x */ + /* Or1/Or8/Or16/Or32/Or64/Max32U(0,x) ==> x */ if (isZeroU(e->Iex.Binop.arg1)) { e2 = e->Iex.Binop.arg2; break; } - /* Or8/Or16/Or32/Or64/Max32U(x,1---1b) ==> 1---1b */ - /* Or8/Or16/Or32/Or64/Max32U(1---1b,x) ==> 1---1b */ + /* Or1/Or8/Or16/Or32/Or64/Max32U(x,1---1b) ==> 1---1b */ + /* Or1/Or8/Or16/Or32/Or64/Max32U(1---1b,x) ==> 1---1b */ if (isOnesU(e->Iex.Binop.arg1) || isOnesU(e->Iex.Binop.arg2)) { e2 = mkOnesOfPrimopResultType(e->Iex.Binop.op); break;