From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22654 invoked by alias); 7 May 2015 09:51:07 -0000 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 Received: (qmail 22638 invoked by uid 89); 7 May 2015 09:51:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 07 May 2015 09:51:05 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9FF22ADC9 for ; Thu, 7 May 2015 09:51:02 +0000 (UTC) Date: Thu, 07 May 2015 09:51:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix(?) PR66002 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2015-05/txt/msg00528.txt.bz2 On Mon, 4 May 2015, Richard Biener wrote: > > This fixes a missed vectorization of a function in paq8p. Without > merged PHI nodes phiopt doesn't recognize adjacent MIN/MAX_EXPRs. > Certainly no other pass I schedule mergephi over cares for merged > PHIs (DCE might even be confused here). > > Bootstrap and regtest running on x86_64-unknown-linux-gnu. So after looking at the (small) fallout I decided to go with the following instead. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2015-05-07 Richard Biener PR tree-optimization/66002 * passes.def: Schedule another pass_merge_phi after ifcombine, right before phiopt. * gcc.dg/vect/vect-125.c: New testcase. Index: gcc/testsuite/gcc.dg/vect/vect-125.c =================================================================== *** gcc/testsuite/gcc.dg/vect/vect-125.c (revision 0) --- gcc/testsuite/gcc.dg/vect/vect-125.c (working copy) *************** *** 0 **** --- 1,19 ---- + /* { dg-do compile } */ + /* { dg-require-effective-target vect_int } */ + /* { dg-require-effective-target vect_pack_trunc } */ + /* { dg-require-effective-target vect_unpack } */ + + void train(short *t, short *w, int n, int err) + { + n=(n+7)&-8; + for (int i=0; i>16)+1>>1); + if (wt<-32768) wt=-32768; + if (wt>32767) wt=32767; + w[i]=wt; + } + } + + /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail vect_no_int_max } } } */ + /* { dg-final { cleanup-tree-dump "vect" } } */ Index: gcc/passes.def =================================================================== *** gcc/passes.def (revision 222872) --- gcc/passes.def (working copy) *************** along with GCC; see the file COPYING3. *** 177,182 **** --- 177,183 ---- NEXT_PASS (pass_cselim); NEXT_PASS (pass_copy_prop); NEXT_PASS (pass_tree_ifcombine); + NEXT_PASS (pass_merge_phi); NEXT_PASS (pass_phiopt); NEXT_PASS (pass_tail_recursion); NEXT_PASS (pass_ch);