From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 374 invoked by alias); 1 Feb 2011 16:47:11 -0000 Received: (qmail 354 invoked by uid 22791); 1 Feb 2011 16:47:09 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Feb 2011 16:47:05 +0000 From: "spop at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/40979] induct benchmark 60% slower when compiled with -fgraphite-identity X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: spop at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: spop at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 01 Feb 2011 16:47: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 X-SW-Source: 2011-02/txt/msg00139.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40979 --- Comment #15 from Sebastian Pop 2011-02-01 16:46:54 UTC --- The vectorizer does not apply because it does not match the canonical form of a reduction: here is the reduction after graphite-identity: # l12__lsm.18_179 = PHI S1: l12_lower_188 = l12__lsm.18_179; l12_lower_184 = D.1589_34 + l12_lower_188; S2: l12__lsm.18_154 = l12_lower_184; Without S1 and S2, this would be recognized as a reduction by the vectorizer. Why we end up with the two extra copies? Here is the original code: # l12_lower_5 = PHI l12_lower_36 = D.1589_321 + l12_lower_5; Graphite does the following: l12_lower_5 = *l12_43(D); l12_lower_36 = D.1589_321 + l12_lower_5; *l12_43(D) = l12_lower_36; Note that at this point we cannot construct this code because we use data references and we are in Gimple form: *l12_43(D) = D.1589_321 + *l12_43(D); So I think that the code produced by Graphite is fine, and the problem is in the cleanups that we're doing after: for instance loop invariant motion could be improved to avoid the extra two statements S1 and S2: # l12__lsm.18_179 = PHI S1: l12_lower_188 = l12__lsm.18_179; l12_lower_184 = D.1589_34 + l12_lower_188; S2: l12__lsm.18_154 = l12_lower_184; I also have tried to run pass_rename_ssa_copies but that would just rename the base variable l12__lsm.18 into l12_lower and wait for the out-of-SSA to remove the extra copies. Constant propagation does not help either... any other suggestions?