--- Comment #38 from bonzini at gnu dot org 2009-02-16 09:01 ---
Outlandish statement: maybe no-condexec if conversion should be moved to the
tree-level?!? Doing this kind of hoisting at the same time as if conversion is
simpler on GIMPLE...
--
bonzini at gnu dot org changed:
--- Comment #37 from steven at gcc dot gnu dot org 2008-11-22 09:13 ---
Re: comment #35 and comment #36
That is code hoisting, again. See Bug 23286 and some the bugs closed as a
duplicate of Bug 23286. Looks like it's time to implement tree-level hoisting
:-)
--
steven at gcc dot gnu
--- Comment #36 from rguenth at gcc dot gnu dot org 2008-10-04 16:16
---
Testcase for that:
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */
long
NumSift (long *array, int b, unsigned long k)
{
if (b)
if (array[k] < array[k + 1L])
++k;
return array[k];
--- Comment #35 from rguenth at gcc dot gnu dot org 2008-10-04 15:58
---
Another missed optimization on the tree level is hoisting of the load of
array[k*4] before the k < j condition which is possible after the PRE
insertion:
:
if (k_4 < j_5(D))
goto ;
else
goto ;
:
pre
--- Comment #34 from rguenth at gcc dot gnu dot org 2008-10-04 15:11
---
Fastest result on a Intel Core Duo with
gcc-4.1 -O3 -fomit-frame-pointer -fno-tree-pre -fno-inline -fschedule-insns:
1273
the interesting thing is that with the above we if-convert
if (array[k] < array[k
--- Comment #33 from wbrana at gmail dot com 2008-10-04 09:22 ---
results with -fno-tree-pre
1749 - 4.4.0 20080926 (experimental)
1701 - 4.3.2
2476 - 4.2.4
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21485
--- Comment #32 from rguenth at gcc dot gnu dot org 2008-10-04 00:57
---
As we PHI-translate k_1 * 4 we are not able to find D.1237_7 * 4 in the
SCCVN tables. So we allocate a new value-id for it. Oops. This is because
once we say its type is unsigned int and once it's unsigned long.
--- Comment #31 from pinskia at gcc dot gnu dot org 2008-10-04 00:13
---
the reduced testcase in comment #30 is optimized by DOM3 though not by PRE.
Running PRE again right after the first PRE still founds more PREable
expressions for this testcase ...
--
http://gcc.gnu.org/bugzill
--- Comment #30 from rguenth at gcc dot gnu dot org 2008-10-03 23:54
---
Comment #6 still applies. On the trunk we do not fully exploit the partial
redundant load of array[k] in
if (k < j)
if (array[k] < array[k + 1L])
++k;
if (array[i] < array[k])
b