Summary: | Doesn't vectorize reduction x += y*y | ||
---|---|---|---|
Product: | gcc | Reporter: | Richard Biener <rguenth> |
Component: | tree-optimization | Assignee: | Richard Biener <rguenth> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | irar, irar |
Priority: | P3 | Keywords: | missed-optimization |
Version: | 4.6.0 | ||
Target Milestone: | 4.6.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2010-12-05 11:30:05 |
Description
Richard Biener
2010-12-03 14:54:36 UTC
Btw, I wonder why we bother to check the defs at all and not just do def1 && flow_bb_inside_loop_p (loop, gimple_bb (def1)) we should be able to handle all vectorizable reduction operands, and their vectorizability will be determined anyway. > As we want to allow internal defs we can also just let calls slip through > here (so we vectorize reductions with veclib vectorized calls as well). Right. (In reply to comment #1) > Btw, I wonder why we bother to check the defs at all and not just do > > def1 && flow_bb_inside_loop_p (loop, gimple_bb (def1)) > > we should be able to handle all vectorizable reduction operands, and > their vectorizability will be determined anyway. This checks that the other def is not a reduction too. Ira I have a tested patch. Author: rguenth Date: Mon Dec 6 10:05:07 2010 New Revision: 167486 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167486 Log: 2010-12-06 Richard Guenther <rguenther@suse.de> PR tree-optimization/46785 * tree-vect-loop.c (vect_is_simple_reduction_1): Also allow call statements as operand definition. * gcc.dg/vect/fast-math-vect-reduc-9.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-9.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-loop.c Fixed on trunk. |