This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/37194] [4.3/4.4 Regression] Autovectorization of small constant iteration loop degrades performance
- From: "irar at il dot ibm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jan 2009 13:58:29 -0000
- Subject: [Bug tree-optimization/37194] [4.3/4.4 Regression] Autovectorization of small constant iteration loop degrades performance
- References: <bug-37194-14936@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from irar at il dot ibm dot com 2009-01-05 13:58 -------
To handle unknown alignment of data, the vectorizer creates a prolog loop to
peel a statically unknown number of scalar iterations (0<=n<VF). This loop is
followed by a vectorized loop (with the remaining, multiple of VF, number of
iterations), and an epilog scalar loop that completes the iterations that were
not executed (0<=n<VF).
Therefore, the created scalar loops have unknown number of iterations, which
prevents their unrolling (while the original scalar loop is unrolled).
Vectorizer cost model does not take possible unrolling into account.
Another cost model problem is that the calculation of scalar outside cost for
this case is performed not for the original scalar version, but includes
run-time guards. Which seems to be wrong in case that the original loop bound
is known. I am going to submit a patch to fix that.
Ira
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37194