Skip to content
Snippets Groups Projects
Commit 2f9d9a34 authored by Richard Henderson's avatar Richard Henderson
Browse files

tcg/optimize: Use fold_xi_to_x for div


Recognize the identity function for division.

Suggested-by: default avatarLuis Pires <luis.pires@eldorado.org.br>
Reviewed-by: default avatarLuis Pires <luis.pires@eldorado.org.br>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
parent 5b5cf479
No related branches found
No related tags found
No related merge requests found
......@@ -1218,7 +1218,11 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op)
static bool fold_divide(OptContext *ctx, TCGOp *op)
{
return fold_const2(ctx, op);
if (fold_const2(ctx, op) ||
fold_xi_to_x(ctx, op, 1)) {
return true;
}
return false;
}
static bool fold_dup(OptContext *ctx, TCGOp *op)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment