This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[4.7 regression?] HImode 'smax' RTL generation
- From: Frédéric RISS <frederic dot riss at gmail dot com>
- To: gcc <gcc at gcc dot gnu dot org>
- Date: Tue, 13 Mar 2012 22:36:11 +0100
- Subject: [4.7 regression?] HImode 'smax' RTL generation
Hello,
I'm trying to port a private backend from GCC 4.5 to 4.7, and I'm seeing
some performance degradation in HImode benchmarks. The backend has no
HImode insns apart from the mov and SImode extensions.
I tracked one of the regressions down to the RTL expansion pass. The 4.7
version won't generate smax RTL patterns for COND_EXPR statements
working on HImode operands.
In GCC 4.5, COND_EXPR was of GIMPLE_SINGLE_RHS rhs_class. At expansion
time, the COND_EXPR would go through:
expand_gimple_stmt -> expand_gimple_stmt_1 -> expand_assigment
-> store_expr -> fold_convert_loc (in the promoted subreg case)
...and the folding converts the COND_EXPR to a MAX_EXPR that generates a
smax RTL pattern.
In 4.7, the COND_EXPR has become a GIMPLE_TERNARY_RHS rhs_class, meaning
that it won't use the expand_assigment path in expand_gimple_stmt_1, but
will use straight expression expansion which will generate control flow
RTL for the COND_EXPR.
Should this be considered a code generation regression, or should the
MAX_EXPR trees be generated at some other point in the middle-end ?
Many thanks,
Fred