In tree-ssa-math-opts.c we already had a pass to cse sin and cos. The new reciprocal sqrt pass is mechanically similar to that one. It does a linear scan over the CFG applying these peephole transformations. This new pass should not be doing a separate IL scan to do its job.
Perhaps it would be a good idea to do a single scan that calls back to all these transformations on every statement? I realize that each pass requires its own setup and may need to do things a bit differently, but perhaps we can save ourselves multiple IL scans if we generalize it a bit. -- Summary: tree-ssa-math-opts.c performs too many IL scans Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dnovillo at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32390