diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2024-12-08 21:15:22 -0600 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2024-12-24 08:32:15 -0800 |
commit | fe1d0074b5cc64e0a548dfba8ab322bd8710c7e5 (patch) | |
tree | b2d292df81a6d44b5b8c48a0a10553f6f8613373 /tcg | |
parent | 4ed2ba3f4abe6b3c03a905d44cdd18b3a3c1ce33 (diff) | |
download | qemu-fe1d0074b5cc64e0a548dfba8ab322bd8710c7e5.zip qemu-fe1d0074b5cc64e0a548dfba8ab322bd8710c7e5.tar.gz qemu-fe1d0074b5cc64e0a548dfba8ab322bd8710c7e5.tar.bz2 |
tcg/optimize: Use finish_folding in fold_sub, fold_sub_vec
Duplicate fold_sub_vec into fold_sub instead of calling it,
now that fold_sub_vec always returns true.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r-- | tcg/optimize.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c index 26790f7..cd052a2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2620,12 +2620,15 @@ static bool fold_sub_vec(OptContext *ctx, TCGOp *op) fold_sub_to_neg(ctx, op)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_sub(OptContext *ctx, TCGOp *op) { - if (fold_const2(ctx, op) || fold_sub_vec(ctx, op)) { + if (fold_const2(ctx, op) || + fold_xx_to_i(ctx, op, 0) || + fold_xi_to_x(ctx, op, 0) || + fold_sub_to_neg(ctx, op)) { return true; } @@ -2637,7 +2640,7 @@ static bool fold_sub(OptContext *ctx, TCGOp *op) ? INDEX_op_add_i32 : INDEX_op_add_i64); op->args[2] = arg_new_constant(ctx, -val); } - return false; + return finish_folding(ctx, op); } static bool fold_sub2(OptContext *ctx, TCGOp *op) |