This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23855] Should not do loop header copying for inner loop
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Sep 2005 13:47:04 -0000
- Subject: [Bug tree-optimization/23855] Should not do loop header copying for inner loop
- References: <20050913094645.23855.rguenth@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-09-13 13:47 -------
Well, it is the case that I have some numerical application that has
such loops and the case of small ie (1 or 2) does happen during boundary
updates, so instead of
if (ie <= 0)
return;
for (j=0; j<je; ++j)
i=0;
do {
foo();
i=i+1;
} while (i<ie);
and executing the if (ie <= 0) exactly one time, we execute it
je times, which is as often as half times the number of total iterations
of the inner loop body. You are probably right that the execution number
without loop header copying is exactly the same, but unswitching this
condition certainly helps for small ie (where loop versioning with constant
ie and completely unrolled inner loop would help even more, of course).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23855