From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10769 invoked by alias); 10 Feb 2015 09:09:00 -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 10717 invoked by uid 48); 10 Feb 2015 09:08:57 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/64909] [4.8/4.9/5 Regression] Missed vectorization with bdver1 Date: Tue, 10 Feb 2015 09:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to Message-ID: In-Reply-To: References: 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-02/txt/msg00945.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64909 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #10 from Richard Biener --- We call Breakpoint 6, ix86_add_stmt_cost (data=0x21f34b0, count=56, kind=scalar_stmt, stmt_info=0x0, misalign=0, where=vect_epilogue) which is because we estimate epilogue cost to # of peeled iterations times scalar iteration cost (4 * 14). The way we do that, if (*peel_iters_epilogue) retval += record_stmt_cost (epilogue_cost_vec, *peel_iters_epilogue * scalar_single_iter_cost, scalar_stmt, NULL, 0, vect_epilogue); is slightly off (we record 4 * 14 scalar stmts but for that we'd need to use scalar_single_iter_num_stmts, not their cost, but well - scalar stmt cost is 1 even for bdver1). So the issue is that scalar iteration cost is somehow very high for bdver1 (14) compared to generic (3). It looks like bdver1 uses scaled costs (not based on 1): 6, /* scalar_stmt_cost. */ 4, /* scalar load_cost. */ 4, /* scalar_store_cost. */ 6, /* vec_stmt_cost. */ 0, /* vec_to_scalar_cost. */ 2, /* scalar_to_vec_cost. */ 4, /* vec_align_load_cost. */ 4, /* vec_unalign_load_cost. */ 4, /* vec_store_cost. */ 2, /* cond_taken_branch_cost. */ 1, /* cond_not_taken_branch_cost. and thus runs into the aforementioned issue.