Summary: | Vectorizer doesn't support dependence created by predictive commoning or PRE | ||
---|---|---|---|
Product: | gcc | Reporter: | Ira Rosen <irar> |
Component: | tree-optimization | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | enhancement | CC: | aldot, changpeng.fang, gaoyunzhong, gcc-bugs, rguenth, spop |
Priority: | P3 | Keywords: | missed-optimization |
Version: | 4.3.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2009-02-25 14:12:51 | |
Bug Depends on: | |||
Bug Blocks: | 53947, 39300 |
Description
Ira Rosen
2008-02-17 09:25:02 UTC
Indeed. Proper testcase: float res[1024], data[1024]; void foo(void) { int i; float tmp = data[0]; for (i = 1; i < 1024; ++i) { float tmp2 = data[i]; res[i] = tmp + tmp2; tmp = tmp2; } } manually "optimized" from res[i] = data[i] + data[i-1]; Or like the following, which is just a bunch of reductions of two elements float data[1024]; void foo(void) { int i; for (i = 1; i < 1024; ++i) data[i] = data[i] + data[i-1]; } (In reply to comment #2) > Or like the following, which is just a bunch of reductions of two elements > float data[1024]; > void foo(void) > { > int i; > for (i = 1; i < 1024; ++i) > data[i] = data[i] + data[i-1]; > } Actually, this loop is not vectorizable. res and data have to be different arrays, otherwise we get read after write dependence with distance 1. Ira Subject: Bug 35229 Author: matz Date: Wed Jul 22 15:30:50 2009 New Revision: 149942 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149942 Log: PR tree-optimization/35229 PR tree-optimization/39300 * tree-ssa-pre.c (includes): Include tree-scalar-evolution.h. (inhibit_phi_insertion): New function. (insert_into_preds_of_block): Call it for REFERENCEs. (init_pre): Initialize and finalize scalar evolutions. * Makefile.in (tree-ssa-pre.o): Depend on tree-scalar-evolution.h . testsuite/ * gcc.dg/vect/vect-pre-interact.c: New test. Added: trunk/gcc/testsuite/gcc.dg/vect/vect-pre-interact.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-pre.c *** Bug 43425 has been marked as a duplicate of this bug. *** *** Bug 57223 has been marked as a duplicate of this bug. *** *** Bug 56595 has been marked as a duplicate of this bug. *** |