This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR18754: add early loop pass, 2nd try
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- Cc: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, Dorit Naishlos <DORIT at il dot ibm dot com>, Giovanni Bajo <giovannibajo at libero dot it>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 21 Jan 2005 08:09:25 -0500 (EST)
- Subject: Re: [PATCH] Fix PR18754: add early loop pass, 2nd try
- References: <Pine.LNX.email@example.com>
On Fri, 21 Jan 2005, Richard Guenther wrote:
On Thu, 20 Jan 2005, Zdenek Dvorak wrote:rename_ssa_copies coalesces ssa variables, not renaming.
The right fix seems to be to add the second SRA pass in the middle of loop
optimizations (just immediately after cunroll). You would also need to
schedule constant propagation pass there (which should just work)
and preferably also cfg_cleanup (the variation from tcb branch that
preserves loop structures).
Yes, I tried this - actually just adding SRA and redphi after cunroll,
but this caused verify failures about not the right ssa form or so. So
I guessed SRA may be not ready to preserve invariants the loop
you probably need to rerun the loop closed ssa form creation afterwards
Ok, tried this again (see proof of concept patch below). With
-O2 -funroll-loops this solves the original testcase of PR18754,
but fails on the C++ testcase verifying the ssa form:
scalar_loops.cpp: In function 'void foo(const Array<2>&, const
scalar_loops.cpp:32: internal compiler error: tree check: expected
ssa_name, have var_decl in verify_ssa, at tree-ssa.c:690
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Any ideas what is going wrong? This doesn't change, if I remove
the rename_ssa_copies() call.
Since you don't have a valid ssa form at that point, it can't possibly
work right :)
Call rewrite_into_ssa (false);