public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/18439] New: vectorizer failed for vector normalization
@ 2004-11-12 1:33 giovannibajo at libero dot it
2004-11-12 2:43 ` [Bug tree-optimization/18439] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: giovannibajo at libero dot it @ 2004-11-12 1:33 UTC (permalink / raw)
To: gcc-bugs
Vectorizer fails to handle this:
-----------------------------------------------------
extern "C" double sqrt(double);
#define NUMPOINTS 50000
static float points[NUMPOINTS][4];
static float opoints[NUMPOINTS][4];
static bool flags[NUMPOINTS];
void NormalizeVectors (void)
{
int i, r;
float s, x, y, z;
static float d = 0.0;
d += 0.2;
if (d > 4) d = 0.0;
for (r=0; r<4; r++)
{
for (i=0; i<NUMPOINTS; i++)
{
x = points[i][0];
y = points[i][1];
z = points[i][2];
s = x * x
+ y * y
+ z * z;
s = d / sqrt (s);
opoints[i][0] = x * s;
opoints[i][1] = y * s;
opoints[i][2] = z * s;
flags[i] = true;
}
}
}
-----------------------------------------------------
loop at bench.cc:79: not vectorized: unhandled data ref: d.0_36 = d
loop at bench.cc:79: bad data references.
This is a bit more complex than the other two I posted, I guess. Anyway, the
first problem seems related to the static variable.
--
Summary: vectorizer failed for vector normalization
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: giovannibajo at libero dot it
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18439
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/18439] vectorizer failed for vector normalization
2004-11-12 1:33 [Bug tree-optimization/18439] New: vectorizer failed for vector normalization giovannibajo at libero dot it
@ 2004-11-12 2:43 ` pinskia at gcc dot gnu dot org
2005-02-11 19:24 ` pinskia at gcc dot gnu dot org
2005-02-11 19:34 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-12 2:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-12 02:43 -------
Confirmed, ICC can do this but does not because it is not very inefficient to do it.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-11-12 02:43:29
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18439
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/18439] vectorizer failed for vector normalization
2004-11-12 1:33 [Bug tree-optimization/18439] New: vectorizer failed for vector normalization giovannibajo at libero dot it
2004-11-12 2:43 ` [Bug tree-optimization/18439] " pinskia at gcc dot gnu dot org
@ 2005-02-11 19:24 ` pinskia at gcc dot gnu dot org
2005-02-11 19:34 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-11 19:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-11 14:19 -------
Really there are two problems which cause the missed vectorizor. One is that we don't scalarize the
static variables that well. So that is the bug which really needs to be fixed first and really is not related
to the vectorizor at all.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Last reconfirmed|2004-11-12 02:43:29 |2005-02-11 14:19:47
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18439
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/18439] vectorizer failed for vector normalization
2004-11-12 1:33 [Bug tree-optimization/18439] New: vectorizer failed for vector normalization giovannibajo at libero dot it
2004-11-12 2:43 ` [Bug tree-optimization/18439] " pinskia at gcc dot gnu dot org
2005-02-11 19:24 ` pinskia at gcc dot gnu dot org
@ 2005-02-11 19:34 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-11 19:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-11 14:47 -------
I filed PR 19905 for the missed optimization not really related (but blocking) the tree vectorizor.
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |19905
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18439
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/18439] vectorizer failed for vector normalization
[not found] <bug-18439-4@http.gcc.gnu.org/bugzilla/>
2011-05-22 16:27 ` steven at gcc dot gnu.org
2012-07-13 8:41 ` rguenth at gcc dot gnu.org
@ 2014-03-13 10:52 ` rguenth at gcc dot gnu.org
2 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-13 10:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18439
Bug 18439 depends on bug 19905, which changed state.
Bug 19905 Summary: Extra V_MAY_DEF on a static variable whose address is not taken (we should be able to move the load out of the loop)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19905
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/18439] vectorizer failed for vector normalization
[not found] <bug-18439-4@http.gcc.gnu.org/bugzilla/>
2011-05-22 16:27 ` steven at gcc dot gnu.org
@ 2012-07-13 8:41 ` rguenth at gcc dot gnu.org
2014-03-13 10:52 ` rguenth at gcc dot gnu.org
2 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-13 8:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18439
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |53947
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-13 08:40:23 UTC ---
Link to vectorizer missed-optimization meta-bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug tree-optimization/18439] vectorizer failed for vector normalization
[not found] <bug-18439-4@http.gcc.gnu.org/bugzilla/>
@ 2011-05-22 16:27 ` steven at gcc dot gnu.org
2012-07-13 8:41 ` rguenth at gcc dot gnu.org
2014-03-13 10:52 ` rguenth at gcc dot gnu.org
2 siblings, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu.org @ 2011-05-22 16:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18439
Steven Bosscher <steven at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2005-12-21 03:49:30 |2011-05-22 17:43:30
CC| |irar at il dot ibm.com
--- Comment #4 from Steven Bosscher <steven at gcc dot gnu.org> 2011-05-22 15:43:42 UTC ---
Still not vectorized with recent GCC:
t.c:19: note: not vectorized: complicated access pattern.
t.c:21: note: not vectorized: complicated access pattern.
1 extern double sqrt(double);
2 typedef unsigned int bool;
3 #define true 1
4 #define NUMPOINTS 50000
5
6 static float points[NUMPOINTS][4];
7 static float opoints[NUMPOINTS][4];
8 static bool flags[NUMPOINTS];
9
10 void NormalizeVectors (void)
11 {
12 int i, r;
13 float s, x, y, z;
14 static float d = 0.0;
15
16 d += 0.2;
17 if (d > 4) d = 0.0;
18
19 for (r=0; r<4; r++)
20 {
21 for (i=0; i<NUMPOINTS; i++)
22 {
23 x = points[i][0];
24 y = points[i][1];
25 z = points[i][2];
26 s = x * x
27 + y * y
28 + z * z;
29 s = d / sqrt (s);
30 opoints[i][0] = x * s;
31 opoints[i][1] = y * s;
32 opoints[i][2] = z * s;
33 flags[i] = true;
34 }
35 }
36 }
37
"GCC: (GNU) 4.6.0 20110312 (experimental) [trunk revision 170907]"
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-03-13 10:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-12 1:33 [Bug tree-optimization/18439] New: vectorizer failed for vector normalization giovannibajo at libero dot it
2004-11-12 2:43 ` [Bug tree-optimization/18439] " pinskia at gcc dot gnu dot org
2005-02-11 19:24 ` pinskia at gcc dot gnu dot org
2005-02-11 19:34 ` pinskia at gcc dot gnu dot org
[not found] <bug-18439-4@http.gcc.gnu.org/bugzilla/>
2011-05-22 16:27 ` steven at gcc dot gnu.org
2012-07-13 8:41 ` rguenth at gcc dot gnu.org
2014-03-13 10:52 ` rguenth at gcc dot gnu.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).