From patchwork Fri Sep 14 19:30:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 184019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6399B2C00A9 for ; Sat, 15 Sep 2012 05:30:27 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1348255828; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Subject:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=La2KwiV JoAjHF6V3waHn8gEQnDs=; b=K00rJL9jDSIaNgSVvBdjq/72pZ6wE31dpiDF/w0 vRxaCTEHNVYsdsCndftpYkT2fmyczwXLtivpejso96FrE1Il6glkG1DU9tqOSy7t Qw4oT07/WhQkFb5wNrygQ/z96cejJ5pGA/O5euP3VqYrs3wzYV8ykWbf330aAkY8 rDtg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Date:From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Gc32yCsbwP2Nkt7odZ1VVENMomqq0gkSfXtrkvburCltRvKZT/3wM620Do5yIY w2EYAeeewYkWTRK+mWLZ55j9F/2vy8lR8QslJtxAik9JUslX5pBRr0uBkEzTZQav oWbZUosnC6e+wf3OwrT7/nhL/Zfe+O0+/4xPvl8IYPWgE=; Received: (qmail 10546 invoked by alias); 14 Sep 2012 19:30:22 -0000 Received: (qmail 10536 invoked by uid 22791); 14 Sep 2012 19:30:20 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail1-relais-roc.national.inria.fr (HELO mail1-relais-roc.national.inria.fr) (192.134.164.82) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Sep 2012 19:30:04 +0000 Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 14 Sep 2012 21:30:02 +0200 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.80) (envelope-from ) id 1TCbaU-0002BL-0J for gcc-patches@gcc.gnu.org; Fri, 14 Sep 2012 21:30:02 +0200 Date: Fri, 14 Sep 2012 21:30:01 +0200 (CEST) From: Marc Glisse To: gcc-patches@gcc.gnu.org Subject: Tighten forwprop1 testing Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hello, recent patches have let optimizations move from forwprop2 to forwprop1. The attached checks that this remains the case. (copyprop1 is the first pass after forwprop1 that does a dce-like cleanup) Only manually tested for now, will check better if it is accepted. 2012-09-15 Marc Glisse * gcc.dg/tree-ssa/forwprop-19.c: Check in forwprop1. * gcc.dg/tree-ssa/forwprop-20.c: Check in forwprop1. * gcc.dg/tree-ssa/forwprop-21.c: Check in copyprop1. * gcc.dg/tree-ssa/forwprop-22.c: Check in copyprop1. Index: testsuite/gcc.dg/tree-ssa/forwprop-19.c =================================================================== --- testsuite/gcc.dg/tree-ssa/forwprop-19.c (revision 191308) +++ testsuite/gcc.dg/tree-ssa/forwprop-19.c (working copy) @@ -1,15 +1,15 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-forwprop2" } */ +/* { dg-options "-O -fdump-tree-forwprop1" } */ typedef int vec __attribute__((vector_size (4 * sizeof (int)))); void f (vec *x1, vec *x2) { vec m = { 1, 2, 3, 0 }; vec n = { 3, 0, 1, 2 }; vec y = __builtin_shuffle (*x1, *x2, n); vec z = __builtin_shuffle (y, m); *x1 = z; } -/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop2" } } */ -/* { dg-final { cleanup-tree-dump "forwprop2" } } */ +/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop1" } } */ +/* { dg-final { cleanup-tree-dump "forwprop1" } } */ Index: testsuite/gcc.dg/tree-ssa/forwprop-20.c =================================================================== --- testsuite/gcc.dg/tree-ssa/forwprop-20.c (revision 191308) +++ testsuite/gcc.dg/tree-ssa/forwprop-20.c (working copy) @@ -1,13 +1,13 @@ /* { dg-do compile } */ /* { dg-require-effective-target double64 } */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O -fdump-tree-forwprop1" } */ #include /* All of these optimizations happen for unsupported vector modes as a consequence of the lowering pass. We need to test with a vector mode that is supported by default on at least some architectures, or make the test target specific so we can pass a flag like -mavx. */ typedef double vecf __attribute__ ((vector_size (2 * sizeof (double)))); typedef int64_t veci __attribute__ ((vector_size (2 * sizeof (int64_t)))); @@ -59,12 +59,12 @@ void k (vecf* r) } void l (double d, vecf* r) { vecf x = { -d, 5 }; vecf y = { d, 4 }; veci m = { 2, 0 }; *r = __builtin_shuffle (x, y, m); // { d, -d } } -/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "optimized" } } */ -/* { dg-final { cleanup-tree-dump "optimized" } } */ +/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop1" } } */ +/* { dg-final { cleanup-tree-dump "forwprop1" } } */ Index: testsuite/gcc.dg/tree-ssa/forwprop-21.c =================================================================== --- testsuite/gcc.dg/tree-ssa/forwprop-21.c (revision 191308) +++ testsuite/gcc.dg/tree-ssa/forwprop-21.c (working copy) @@ -1,13 +1,16 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-optimized" } */ +/* { dg-options "-O -fdump-tree-copyprop1" } */ typedef int v4si __attribute__ ((vector_size (4 * sizeof(int)))); int test (v4si *x, v4si *y) { v4si m = { 2, 3, 6, 5 }; v4si z = __builtin_shuffle (*x, *y, m); return z[2]; } -/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "optimized" } } */ -/* { dg-final { cleanup-tree-dump "optimized" } } */ + +/* Optimization in forwprop1, cleanup in copyprop1. */ + +/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "copyprop1" } } */ +/* { dg-final { cleanup-tree-dump "copyprop1" } } */ Index: testsuite/gcc.dg/tree-ssa/forwprop-22.c =================================================================== --- testsuite/gcc.dg/tree-ssa/forwprop-22.c (revision 191308) +++ testsuite/gcc.dg/tree-ssa/forwprop-22.c (working copy) @@ -1,18 +1,20 @@ /* { dg-do compile } */ /* { dg-require-effective-target vect_double } */ /* { dg-require-effective-target vect_perm } */ -/* { dg-options "-O -fdump-tree-optimized" } */ +/* { dg-options "-O -fdump-tree-copyprop1" } */ typedef double vec __attribute__((vector_size (2 * sizeof (double)))); void f (vec *px, vec *y, vec *z) { vec x = *px; vec t1 = { x[1], x[0] }; vec t2 = { x[0], x[1] }; *y = t1; *z = t2; } -/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "optimized" } } */ -/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "optimized" } } */ -/* { dg-final { cleanup-tree-dump "optimized" } } */ +/* Optimization in forwprop1, cleanup in copyprop1. */ + +/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "copyprop1" } } */ +/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "copyprop1" } } */ +/* { dg-final { cleanup-tree-dump "copyprop1" } } */