This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] tree-ssa vs. fold
- From: Roger Sayle <roger at eyesopen dot com>
- To: Jeff Sturm <jsturm at one-point dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 6 Jun 2003 19:25:34 -0600 (MDT)
- Subject: Re: [tree-ssa] tree-ssa vs. fold
Hi Jeff,
> d) Fix fold() not to save_expr.
>
> Is d) the only real choice? Am I missing something easy?
Maybe. A very large number of optimizations in fold() use
save_expr (I committed one just this morning) and it would
probably be a significant performance hit to disable them all.
Even if this was just for java, there are a large number of
optimizations that you'd have to conditionalize.
However, one solution may be to provide a save_expr language
hook or equivalent. For tree-ssa/gimple, this would generate an
assignment to a temporary and insert the assignment immediately
before the current statement (recorded in a global perhaps), and
then return the temporary. For non-SSA, the hook would do as it
does at the moment.
There are a number of hooks or callbacks it would be nice for
fold to have, so that language front-ends such as java and ada
have some form of control over the optimizations/transformations
that it performs. Avoiding bit-field accesses when generating
.class files comes to mind.
Does a save_expr hook seem a reasonable compromise/workable?
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833