public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/18940] New: Loop is not vectorized when it should be
@ 2004-12-11 18:47 pinskia at gcc dot gnu dot org
2004-12-11 18:52 ` [Bug tree-optimization/18940] " pinskia at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-11 18:47 UTC (permalink / raw)
To: gcc-bugs
Here is another case which my tree combiner confuses the other tree optimizations but it should not.
I get in .vect: "not vectorized: number of iterations cannot be computed.".
If I change D1360 to be just n, it works.
If I change "n <= 1" to be "D1360 <= 0" It works (on the mainline without my tree combiner which is
the opposite of what my tree combiner does).
typedef float afloat __attribute__ ((__aligned__(16)));
int
main1 (int n , afloat * __restrict__ pa, afloat * __restrict__ pb)
{
int i;
int ivtmp51;
int ivtmp35;
int D1360 = n/2;
if (n <= 1) return 0;
ivtmp35 = 1;
do {
ivtmp51 = ivtmp35;
pa[ivtmp51] = pb[ivtmp51];
ivtmp35 = ivtmp51 + 1;
} while (D1360 > ivtmp51);
return 0;
}
--
Summary: Loop is not vectorized when it should be
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: minor
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18940
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/18940] Loop is not vectorized when it should be
2004-12-11 18:47 [Bug tree-optimization/18940] New: Loop is not vectorized when it should be pinskia at gcc dot gnu dot org
@ 2004-12-11 18:52 ` pinskia at gcc dot gnu dot org
2004-12-12 5:00 ` dberlin at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-11 18:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-11 18:52 -------
This problem causes the following "regressions" with my tree combiner:
FAIL: gcc.dg/vect/vect-58.c scan-tree-dump-times vectorized 1 loops 1
FAIL: gcc.dg/vect/vect-60.c scan-tree-dump-times vectorized 1 loops 1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18940
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/18940] Loop is not vectorized when it should be
2004-12-11 18:47 [Bug tree-optimization/18940] New: Loop is not vectorized when it should be pinskia at gcc dot gnu dot org
2004-12-11 18:52 ` [Bug tree-optimization/18940] " pinskia at gcc dot gnu dot org
@ 2004-12-12 5:00 ` dberlin at gcc dot gnu dot org
2004-12-22 7:38 ` pinskia at gcc dot gnu dot org
2005-03-23 3:08 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2004-12-12 5:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dberlin at gcc dot gnu dot org 2004-12-12 04:59 -------
These are real regressions because we are losing information.
In particular, when you replace D1360 <= 0 with n <= 1, we no longer can
determine that D1360 is <= 1.
This would require a pretty powerful assertion framework (when we learn
something about n, we'd have to know all expressions whose value depends on n,
which seems a bit much) to make up for.
I think for now we shouldn't combine before trying these transformations, or
limit combine until at least after loop, for things like conditionals whose
values have immediate uses in loop exit tests or something.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18940
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/18940] Loop is not vectorized when it should be
2004-12-11 18:47 [Bug tree-optimization/18940] New: Loop is not vectorized when it should be pinskia at gcc dot gnu dot org
2004-12-11 18:52 ` [Bug tree-optimization/18940] " pinskia at gcc dot gnu dot org
2004-12-12 5:00 ` dberlin at gcc dot gnu dot org
@ 2004-12-22 7:38 ` pinskia at gcc dot gnu dot org
2005-03-23 3:08 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-22 7:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-22 07:38 -------
I was able to work around the problem which my tree combiner causes by doing what the old forward-
pro did which is only combine into a COND_EXPR if we used the SSA_NAME only once in the COND_EXPR
or when the resulting result is a constant (so we don't miss some optimizations).
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|minor |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-12-22 07:38:34
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18940
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/18940] Loop is not vectorized when it should be
2004-12-11 18:47 [Bug tree-optimization/18940] New: Loop is not vectorized when it should be pinskia at gcc dot gnu dot org
` (2 preceding siblings ...)
2004-12-22 7:38 ` pinskia at gcc dot gnu dot org
@ 2005-03-23 3:08 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-23 3:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-23 03:08 -------
suspend this one as this is hard and most likely not going to happen.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |SUSPENDED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18940
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-03-23 3:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-11 18:47 [Bug tree-optimization/18940] New: Loop is not vectorized when it should be pinskia at gcc dot gnu dot org
2004-12-11 18:52 ` [Bug tree-optimization/18940] " pinskia at gcc dot gnu dot org
2004-12-12 5:00 ` dberlin at gcc dot gnu dot org
2004-12-22 7:38 ` pinskia at gcc dot gnu dot org
2005-03-23 3:08 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).