[Bug tree-optimization/43423] gcc should vectorize this loop through iteration range splitting
--- Comment #2 from pinskia at gcc dot gnu dot org 2010-03-18 18:22 --- Well it could be vectorized even without range splitting. The issue is the sinking of the store to a[i]. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Component|c |tree-optimization http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43423
Re: [Bug tree-optimization/43423] gcc should vectorize this loop through iteration range splitting
Well it could be vectorized even without range splitting. The issue is the sinking of the store to a[i]. You mean that the problem is the if-conversion of the stores a[i] = ...
[Bug tree-optimization/43423] gcc should vectorize this loop through iteration range splitting
--- Comment #3 from sebpop at gmail dot com 2010-03-18 18:33 --- Subject: Re: gcc should vectorize this loop through iteration range splitting Well it could be vectorized even without range splitting. The issue is the sinking of the store to a[i]. You mean that the problem is the if-conversion of the stores a[i] = ... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43423
[Bug tree-optimization/43423] gcc should vectorize this loop through iteration range splitting
--- Comment #4 from pinskia at gcc dot gnu dot org 2010-03-18 18:38 --- (In reply to comment #3) Subject: Re: gcc should vectorize this loop through iteration range splitting You mean that the problem is the if-conversion of the stores a[i] = ... If we rewrite the code like: int a[100], b[100], c[100]; void foo(int n, int mid) { int i; for(i=0; in; i++) { int t; int ai = a[i], bi = b[i], ci = c[i]; if (i mid) t = ai + bi; else t = ai + ci; a[i] = t; } } --- CUT --- This gets vectorized as we produce an if-cvt first. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords||missed-optimization Last reconfirmed|-00-00 00:00:00 |2010-03-18 18:38:42 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43423
[Bug tree-optimization/43423] gcc should vectorize this loop through iteration range splitting
--- Comment #5 from spop at gcc dot gnu dot org 2010-03-18 18:51 --- Yes, I think we should improve if-conversion to handle more complex cases. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43423