From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58296 invoked by alias); 1 May 2015 11:45:54 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 58243 invoked by uid 48); 1 May 2015 11:45:50 -0000 From: "alalaw01 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/65962] New: Missed vectorization of strided stores Date: Fri, 01 May 2015 11:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: alalaw01 at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-05/txt/msg00022.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65962 Bug ID: 65962 Summary: Missed vectorization of strided stores Product: gcc Version: 5.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: alalaw01 at gcc dot gnu.org Target Milestone: --- This does not vectorize at -O3 on x86_64/-mavx or aarch64: int loop (int *data) { int tot = 0; for (int i = 0; i < 256; i++) data[i * 2] += 7; return tot; } -fdump-tree-vect-details reveals: loadstore.c:6:3: note: === vect_analyze_data_ref_accesses === loadstore.c:6:3: note: Detected single element interleaving *_8 step 8 loadstore.c:6:3: note: Data access with gaps requires scalar epilogue loop loadstore.c:6:3: note: not consecutive access *_8 = _10; loadstore.c:6:3: note: not vectorized: complicated access pattern. loadstore.c:6:3: note: bad data access. However, a similar testcase that only reads from those locations, vectorizes ok: int loop_12 (int *data) { int tot = 0; for (int i = 0; i < 256; i++) tot += data[i * 2]; return tot; } blocksort.c:6:3: note: === vect_analyze_data_ref_accesses === blocksort.c:6:3: note: Detected single element interleaving *_7 step 8 blocksort.c:6:3: note: Data access with gaps requires scalar epilogue loop