From patchwork Mon Aug 11 14:43:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 379030 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1C66D14013A for ; Tue, 12 Aug 2014 00:46:48 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=bkKqCDJw3KexqbdJOJiDAzH4gKnL8CbaJlZ/mM5RQOc6f9gp6PDnD xXs6WUGGO7rQXG3Bm6pv+gjBJp983BEMvv5NN7MIYBikcie+AITmbrXRZniofOoo TNg8TvuX53Wfjt+tKXrTvxwQU7ZEo3YtYIJwfBl6CAZBq3EbCCD030= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=XgaduUSFHHgEbm/TvUBzkX/kOeY=; b=bVvwrni++07i3UjXUIbu U9pFPfv3iF9B+ncvaQqaA9AZs7yJDok/Pw89s891qocXC8q0w1z0uD5aJceFPR2e tPagh5bRDBrvnRTVitD9/9eQKxifXtT8zd2F50xpk1JOuN+z9MuH540hl7cb9f2M +zOskcmDgDanqKOWmmfnbnQ= Received: (qmail 9036 invoked by alias); 11 Aug 2014 14:46:40 -0000 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 Received: (qmail 9004 invoked by uid 89); 11 Aug 2014 14:46:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham 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; Mon, 11 Aug 2014 14:46:38 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EF482AC1F for ; Mon, 11 Aug 2014 14:46:34 +0000 (UTC) Date: Mon, 11 Aug 2014 16:43:26 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR62075 Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 The following fixes SLP pure/hybrid detection with patterns. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk sofar. Richard. 2014-08-11 Richard Biener PR tree-optimization/62075 * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Properly handle uses in patterns. * gcc.dg/vect/pr62075.c: New testcase. Index: gcc/tree-vect-slp.c =================================================================== *** gcc/tree-vect-slp.c (revision 213811) --- gcc/tree-vect-slp.c (working copy) *************** vect_detect_hybrid_slp_stmts (slp_tree n *** 1793,1799 **** && (stmt_vinfo = vinfo_for_stmt (use_stmt)) && !STMT_SLP_TYPE (stmt_vinfo) && (STMT_VINFO_RELEVANT (stmt_vinfo) ! || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo))) && !(gimple_code (use_stmt) == GIMPLE_PHI && STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def)) --- 1793,1802 ---- && (stmt_vinfo = vinfo_for_stmt (use_stmt)) && !STMT_SLP_TYPE (stmt_vinfo) && (STMT_VINFO_RELEVANT (stmt_vinfo) ! || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_vinfo)) ! || (STMT_VINFO_IN_PATTERN_P (stmt_vinfo) ! && STMT_VINFO_RELATED_STMT (stmt_vinfo) ! && !STMT_SLP_TYPE (vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_vinfo))))) && !(gimple_code (use_stmt) == GIMPLE_PHI && STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def)) Index: gcc/testsuite/gcc.dg/vect/pr62075.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr62075.c (revision 0) +++ gcc/testsuite/gcc.dg/vect/pr62075.c (working copy) @@ -0,0 +1,22 @@ +/* { dg-do compile } */ + +int a[16][2]; +struct A +{ + int b[16][2]; + int c[16][1]; +}; + +void +foo (struct A *x) +{ + int i; + for (i = 0; i < 16; ++i) + { + x->b[i][0] = a[i][0]; + x->c[i][0] = 0 != a[i][0]; + x->b[i][1] = a[i][1]; + } +} + +/* { dg-final { cleanup-tree-dump "vect" } } */