From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30436 invoked by alias); 10 Jun 2011 11:16:37 -0000 Received: (qmail 30428 invoked by uid 22791); 10 Jun 2011 11:16:36 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,TW_TM X-Spam-Check-By: sourceware.org Received: from mail-pz0-f47.google.com (HELO mail-pz0-f47.google.com) (209.85.210.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Jun 2011 11:16:22 +0000 Received: by pzk36 with SMTP id 36so1257952pzk.20 for ; Fri, 10 Jun 2011 04:16:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.150.10 with SMTP id x10mr313744wfd.321.1307704582090; Fri, 10 Jun 2011 04:16:22 -0700 (PDT) Received: by 10.143.93.4 with HTTP; Fri, 10 Jun 2011 04:16:22 -0700 (PDT) In-Reply-To: References: Date: Fri, 10 Jun 2011 11:37:00 -0000 Message-ID: Subject: Re: [patch] Fix PR tree-optimization/49318 From: Ira Rosen To: Richard Guenther Cc: gcc-patches@gcc.gnu.org, Patch Tracking Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00825.txt.bz2 On 10 June 2011 12:14, Richard Guenther wrote: > On Fri, Jun 10, 2011 at 9:19 AM, Ira Rosen wrote: >> Hi, >> >> The test in PR 49318 fails because the vectorizer recognizes address >> computation sequence as a widening-multiplication pattern, while such >> sequence is not relevant to vectorization. The problem is that the >> vectorizer doesn't check if a statement is going to be vectorized >> before replacing it with a pattern. Moreover, the vectorizer first >> detects the patterns and only after that looks for relevant >> statements. Changing the order is not a good option, since statements >> relevance is defined also by their belonging to a pattern. >> >> This patch solves the problem by removing pattern statements that were >> created for statements that are not supposed to be vectorized. >> >> Bootstrapped with vectorization enabled on powerpc64-suse-linux and >> tested on powerpc64-suse-linux and x86_64-suse-linux. >> Committed. > > Ick, yeah. =A0I remember running into this ordering issue when doing the > multi-vector size reorgs... > > In the end I think we should not generate the pattern stmt during > pattern matching but only mark the relevant statements with a > pattern kind. =A0Say, for each pattern we have a "main" statement > that has related stmts belonging to the pattern that define uses > of the "main" statement - mark those to refer to that "main" statement. > For that "main" statement simply record an enum value, like, > widening_mult. =A0Then only at vectorized statement > generation time actually generate the vectorized form of the > pattern statement. > > Thus, the non-vectorized pattern statements would never be generated. > > So, separate analysis and transform more properly. > > Of course I didn't get around to implement the above ... (we'd have > a new vectorizable_pattern worker). Sounds like a good idea. I'll give it a try. Thanks, Ira > > Richard. > >> Ira >> >> ChangeLog: >> >> =A0 =A0 PR tree-optimization/49318 >> =A0 =A0 * tree-vect-loop.c (vect_determine_vectorization_factor): >> =A0 =A0 Remove irrelevant pattern statements. >> >> testsuite/ChangeLog: >> >> =A0 =A0 PR tree-optimization/49318 >> =A0 =A0 * gcc.dg/vect/pr49318.c: New test. >> >