From patchwork Fri Feb 3 13:24:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 139368 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 52D6C104796 for ; Sat, 4 Feb 2012 00:24:45 +1100 (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=1328880287; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:Message-ID:Subject:From:To: Cc:Date:Content-Type:Content-Transfer-Encoding:Mime-Version: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=wbrxELEYlEGEI0ar90Vs I4DEUQc=; b=RQJ6sVIB6o7xxGaNRyQ3q4WZhLz6qOmqpIb+WHD7OjzscCtLjjaa lALBNXC/wjkiXFHF5/rdaD3xy6KdmlG98HkY3JDV+umuwrVVbC5Jpo0q5NkONJ4I dfdvi1pe06A1CK4bjQzv8JJAJPjboDOSIgHlXh++uasU/h/HkWyq7HQ= 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:Received:Received:Received:Received:Message-ID:Subject:From:To:Cc:Date:Content-Type:Content-Transfer-Encoding:Mime-Version:X-Content-Scanned:x-cbid:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=rAuCvz7JesujqrcugzMjzHXClU8oSd+dhZ2rNTNanRBe8LZbznvULdJBG63y/6 5o82Jru6NBLK4AyhpRyC3xMlATgchE639k5MR3OErb8M1vTTSPpAu+nIisOLuyUy 7iRR0GN3wJQ5t6BmsvdxmDc0CA5GeRSCM0E5j+9zbq4tE=; Received: (qmail 27196 invoked by alias); 3 Feb 2012 13:24:40 -0000 Received: (qmail 27008 invoked by uid 22791); 3 Feb 2012 13:24:38 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e9.ny.us.ibm.com (HELO e9.ny.us.ibm.com) (32.97.182.139) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Feb 2012 13:24:18 +0000 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 3 Feb 2012 08:24:17 -0500 Received: from d01dlp01.pok.ibm.com (9.56.224.56) by e9.ny.us.ibm.com (192.168.1.109) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 3 Feb 2012 08:24:16 -0500 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 52EB938C806A for ; Fri, 3 Feb 2012 08:24:16 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q13DOFib3301624 for ; Fri, 3 Feb 2012 08:24:15 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q13DOFJe008930 for ; Fri, 3 Feb 2012 08:24:15 -0500 Received: from [9.65.117.14] (sig-9-65-117-14.mts.ibm.com [9.65.117.14]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q13DOFQZ008901; Fri, 3 Feb 2012 08:24:15 -0500 Message-ID: <1328275454.2799.13.camel@gnopaine> Subject: [PATCH] Fix PR50969 From: "William J. Schmidt" To: gcc-patches@gcc.gnu.org Cc: bergner@vnet.ibm.com Date: Fri, 03 Feb 2012 07:24:14 -0600 Mime-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12020313-7182-0000-0000-000000AABE67 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 This fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50969 by slightly raising the cost of vector permutes on powerpc64 VSX targets (and ensuring those costs are correctly used). This reverses the performance loss for 168.wupwise, and gives a slight boost to 433.milc as well. In the long run, we will want to model VSX permutes differently, since the real issue is that only one floating-point pipe can hold a permute at a time. Thus the present patch can be overly conservative when permutes are rare compared with other vector instructions. Bootstrapped and regtested on powerpc64-linux-gnu with no failures. OK for trunk? Thanks, Bill 2012-02-03 Bill Schmidt PR tree-optimization/50969 * tree-vect-stmts.c (vect_model_store_cost): Correct statement cost to use vec_perm rather than vector_stmt. (vect_model_load_cost): Likewise. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Revise cost of vec_perm for TARGET_VSX. Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c (revision 183871) +++ gcc/tree-vect-stmts.c (working copy) @@ -882,7 +882,7 @@ vect_model_store_cost (stmt_vec_info stmt_info, in { /* Uses a high and low interleave operation for each needed permute. */ inside_cost = ncopies * exact_log2(group_size) * group_size - * vect_get_stmt_cost (vector_stmt); + * vect_get_stmt_cost (vec_perm); if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_store_cost: strided group_size = %d .", @@ -988,7 +988,7 @@ vect_model_load_cost (stmt_vec_info stmt_info, int { /* Uses an even and odd extract operations for each needed permute. */ inside_cost = ncopies * exact_log2(group_size) * group_size - * vect_get_stmt_cost (vector_stmt); + * vect_get_stmt_cost (vec_perm); if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_load_cost: strided group_size = %d .", Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 183871) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -3540,9 +3540,13 @@ rs6000_builtin_vectorization_cost (enum vect_cost_ case vec_to_scalar: case scalar_to_vec: case cond_branch_not_taken: - case vec_perm: return 1; + case vec_perm: + if (!TARGET_VSX) + return 1; + return 2; + case cond_branch_taken: return 3;