diff mbox series

[04/46] tcg/optimize: Use finish_folding in fold_add, fold_add_vec

Message ID 20241210152401.1823648-5-richard.henderson@linaro.org (mailing list archive)
State New
Headers show
Series tcg: Remove in-flight mask data from OptContext | expand

Commit Message

Richard Henderson Dec. 10, 2024, 3:23 p.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/optimize.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Pierrick Bouvier Dec. 17, 2024, 8:04 p.m. UTC | #1
On 12/10/24 07:23, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   tcg/optimize.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tcg/optimize.c b/tcg/optimize.c
> index 6644d24da6..3f2f351bae 100644
> --- a/tcg/optimize.c
> +++ b/tcg/optimize.c
> @@ -978,7 +978,7 @@ static void finish_ebb(OptContext *ctx)
>       finish_bb(ctx);
>   }
>   
> -static void finish_folding(OptContext *ctx, TCGOp *op)
> +static bool finish_folding(OptContext *ctx, TCGOp *op)
>   {
>       const TCGOpDef *def = &tcg_op_defs[op->opc];
>       int i, nb_oargs;
> @@ -996,6 +996,7 @@ static void finish_folding(OptContext *ctx, TCGOp *op)
>               ts_info(ts)->s_mask = ctx->s_mask;
>           }
>       }
> +    return true;
>   }
>   
>   /*
> @@ -1214,7 +1215,7 @@ static bool fold_add(OptContext *ctx, TCGOp *op)
>           fold_xi_to_x(ctx, op, 0)) {
>           return true;
>       }
> -    return false;
> +    return finish_folding(ctx, op);
>   }
>   
>   /* We cannot as yet do_constant_folding with vectors. */
> @@ -1224,7 +1225,7 @@ static bool fold_add_vec(OptContext *ctx, TCGOp *op)
>           fold_xi_to_x(ctx, op, 0)) {
>           return true;
>       }
> -    return false;
> +    return finish_folding(ctx, op);
>   }
>   
>   static bool fold_addsub2(OptContext *ctx, TCGOp *op, bool add)

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff mbox series

Patch

diff --git a/tcg/optimize.c b/tcg/optimize.c
index 6644d24da6..3f2f351bae 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -978,7 +978,7 @@  static void finish_ebb(OptContext *ctx)
     finish_bb(ctx);
 }
 
-static void finish_folding(OptContext *ctx, TCGOp *op)
+static bool finish_folding(OptContext *ctx, TCGOp *op)
 {
     const TCGOpDef *def = &tcg_op_defs[op->opc];
     int i, nb_oargs;
@@ -996,6 +996,7 @@  static void finish_folding(OptContext *ctx, TCGOp *op)
             ts_info(ts)->s_mask = ctx->s_mask;
         }
     }
+    return true;
 }
 
 /*
@@ -1214,7 +1215,7 @@  static bool fold_add(OptContext *ctx, TCGOp *op)
         fold_xi_to_x(ctx, op, 0)) {
         return true;
     }
-    return false;
+    return finish_folding(ctx, op);
 }
 
 /* We cannot as yet do_constant_folding with vectors. */
@@ -1224,7 +1225,7 @@  static bool fold_add_vec(OptContext *ctx, TCGOp *op)
         fold_xi_to_x(ctx, op, 0)) {
         return true;
     }
-    return false;
+    return finish_folding(ctx, op);
 }
 
 static bool fold_addsub2(OptContext *ctx, TCGOp *op, bool add)