This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Don't lower MIN_EXPR and MAX_EXPR [was Re: GCC Benchmarks(coybench), AMD64 and i686, 14 August 2004]
I thought we had this discussion a while ago, and the result was "MIN
and MAX are GIMPLE, but we might as well keep the early simplification"
for some reason.
Here is a patch to disable it. I don't see any benefit in it.
I have a patch to synthesize MIN_EXPR and MAX_EXPR in phiopt, but it is
not well tested yet and I still hope I'll be able to polish my
fold-based phiopt in time for stage2.
Paolo
2004-08-19 Paolo Bonzini <bonzini@gnu.org>
* gimplify.c (gimplify_minimax_expr): Remove.
(gimplify_expr) <MIN_EXPR, MAX_EXPR>: Remove special handling.
Index: gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gimplify.c,v
retrieving revision 2.62
diff -u -p -r2.62 gimplify.c
--- gimplify.c 12 Aug 2004 03:54:11 -0000 2.62
+++ gimplify.c 19 Aug 2004 06:29:10 -0000
@@ -1414,34 +1414,6 @@ gimplify_conversion (tree *expr_p)
return GS_OK;
}
-/* Reduce MIN/MAX_EXPR to a COND_EXPR for further gimplification. */
-
-static enum gimplify_status
-gimplify_minimax_expr (tree *expr_p, tree *pre_p, tree *post_p)
-{
- tree op1 = TREE_OPERAND (*expr_p, 0);
- tree op2 = TREE_OPERAND (*expr_p, 1);
- enum tree_code code;
- enum gimplify_status r0, r1;
-
- if (TREE_CODE (*expr_p) == MIN_EXPR)
- code = LE_EXPR;
- else
- code = GE_EXPR;
-
- r0 = gimplify_expr (&op1, pre_p, post_p, is_gimple_val, fb_rvalue);
- r1 = gimplify_expr (&op2, pre_p, post_p, is_gimple_val, fb_rvalue);
-
- *expr_p = build (COND_EXPR, TREE_TYPE (*expr_p),
- build (code, boolean_type_node, op1, op2),
- op1, op2);
-
- if (r0 == GS_ERROR || r1 == GS_ERROR)
- return GS_ERROR;
- else
- return GS_OK;
-}
-
/* Subroutine of gimplify_compound_lval.
Converts an ARRAY_REF to the equivalent *(&array + offset) form. */
@@ -3874,11 +3846,6 @@ gimplify_expr (tree *expr_p, tree *pre_p
}
break;
- case MIN_EXPR:
- case MAX_EXPR:
- ret = gimplify_minimax_expr (expr_p, pre_p, post_p);
- break;
-
case LABEL_DECL:
/* We get here when taking the address of a label. We mark
the label as "forced"; meaning it can never be removed and