From patchwork Tue Jul 17 12:32:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171413 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 AEC042C0081 for ; Tue, 17 Jul 2012 22:32:42 +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=1343133163; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=y5ME+8yfNV1bkUNnVeGHVlGF0w0=; b=v+wSfcd3EenTgXz +6FBsP4YEqGC6SzWhqa0IpdjuaZc2xTOoC172eewHFkWNAZ5a9SwzgQYjl1LBYFt bs9Z3rTNDmKAogtOxkrXF5vQYXEktycIh1lxOc6OfyLtwsoKlHP1eMFG1wdD0T/7 cftnrmB7k4wU3rLgjmGOsmzNQ+z0= 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:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=h0k1VDrRcHGYPBBhv72Y94SiwP7gtfHWkP8iPfwLREl+8XYtI7MJ6Z82O2fU2Y 51g0q5NcZfekV8LP109rUmbpxxKfbz4Mx6Py+6SG3j61J6lmxgcUYWelSVOq6bga Q3ZhQFSPRQE62V23xfCHsuDBwWkZOoabLCn5WWhF34GLs=; Received: (qmail 1862 invoked by alias); 17 Jul 2012 12:32:38 -0000 Received: (qmail 1854 invoked by uid 22791); 17 Jul 2012 12:32:37 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, TW_SV, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jul 2012 12:32:19 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6HCWIZc024572 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 17 Jul 2012 08:32:19 -0400 Received: from anchor.twiddle.home (vpn-235-96.phx2.redhat.com [10.3.235.96]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6HCWI29021202; Tue, 17 Jul 2012 08:32:18 -0400 Message-ID: <50055B52.5040307@redhat.com> Date: Tue, 17 Jul 2012 05:32:18 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Jakub Jelinek CC: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 0/7] Clean up widen mult even/odd References: <1341908571-30346-1-git-send-email-rth@redhat.com> <20120710090953.GA17452@laptop.redhat.com> In-Reply-To: <20120710090953.GA17452@laptop.redhat.com> X-IsSubscribed: yes 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 On 07/10/2012 02:09 AM, Jakub Jelinek wrote: > On Tue, Jul 10, 2012 at 10:22:44AM +0200, Richard Henderson wrote: >> I've not touched the interface to supportable_widening_operation, >> which is still prepared to return a CALL_EXPR and some decls. After >> this patch set it will never do so. I'm undecided as to whether we >> ought to be prepared for such in the future, or whether this should >> simply go in as a completely separate patch that could in the future >> be easily reverted. > > I think it would be nice to remove the support for widening operation > calls as a follow-up, if we ever need it in the future, we can restore > it from svn and it will simplify the callers that already handle way too > many different cases. The cleanup is much smaller than I hoped, since we may still generate calls via the supportable_convert_operation and supportable_narrowing_operation paths. Nevertheless... tested on x86_64 and committed. r~ * tree-vect-stmts.c (supportable_widening_operation): Remove decl parameters. (vectorizable_conversion): Update supportable_widening_operation call. * tree-vect-patterns.c (vect_recog_widen_mult_pattern): Likewise. (vect_recog_widen_shift_pattern): Likewise. * tree-vectorizer.h: Update decl. diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index e8ac42a..595b9b6 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -599,7 +599,6 @@ vect_recog_widen_mult_pattern (VEC (gimple, heap) **stmts, tree type, half_type0, half_type1; gimple pattern_stmt; tree vectype, vectype_out = NULL_TREE; - tree dummy; tree var; enum tree_code dummy_code; int dummy_int; @@ -692,8 +691,8 @@ vect_recog_widen_mult_pattern (VEC (gimple, heap) **stmts, || !vectype_out || !supportable_widening_operation (WIDEN_MULT_EXPR, last_stmt, vectype_out, vectype, - &dummy, &dummy, &dummy_code, - &dummy_code, &dummy_int, &dummy_vec)) + &dummy_code, &dummy_code, + &dummy_int, &dummy_vec)) return NULL; *type_in = vectype; @@ -1370,7 +1369,6 @@ vect_recog_widen_shift_pattern (VEC (gimple, heap) **stmts, tree type, half_type0; gimple pattern_stmt; tree vectype, vectype_out = NULL_TREE; - tree dummy; tree var; enum tree_code dummy_code; int dummy_int; @@ -1441,9 +1439,8 @@ vect_recog_widen_shift_pattern (VEC (gimple, heap) **stmts, || !vectype_out || !supportable_widening_operation (WIDEN_LSHIFT_EXPR, last_stmt, vectype_out, vectype, - &dummy, &dummy, &dummy_code, - &dummy_code, &dummy_int, - &dummy_vec)) + &dummy_code, &dummy_code, + &dummy_int, &dummy_vec)) return NULL; *type_in = vectype; diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 2f372df..358c2d5 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -2410,8 +2410,8 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi, case WIDEN: if (supportable_widening_operation (code, stmt, vectype_out, vectype_in, - &decl1, &decl2, &code1, &code2, - &multi_step_cvt, &interm_types)) + &code1, &code2, &multi_step_cvt, + &interm_types)) { /* Binary widening operation can only be supported directly by the architecture. */ @@ -2443,18 +2443,16 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi, goto unsupported; } else if (!supportable_widening_operation (code, stmt, vectype_out, - cvt_type, &decl1, &decl2, - &codecvt1, &codecvt2, - &multi_step_cvt, + cvt_type, &codecvt1, + &codecvt2, &multi_step_cvt, &interm_types)) continue; else gcc_assert (multi_step_cvt == 0); if (supportable_widening_operation (NOP_EXPR, stmt, cvt_type, - vectype_in, NULL, NULL, &code1, - &code2, &multi_step_cvt, - &interm_types)) + vectype_in, &code1, &code2, + &multi_step_cvt, &interm_types)) break; } @@ -6262,9 +6260,6 @@ vect_is_simple_use_1 (tree operand, gimple stmt, loop_vec_info loop_vinfo, Output: - CODE1 and CODE2 are codes of vector operations to be used when vectorizing the operation, if available. - - DECL1 and DECL2 are decls of target builtin functions to be used - when vectorizing the operation, if available. In this case, - CODE1 and CODE2 are CALL_EXPR. - MULTI_STEP_CVT determines the number of required intermediate steps in case of multi-step conversion (like char->short->int - in that case MULTI_STEP_CVT will be 1). @@ -6274,8 +6269,6 @@ vect_is_simple_use_1 (tree operand, gimple stmt, loop_vec_info loop_vinfo, bool supportable_widening_operation (enum tree_code code, gimple stmt, tree vectype_out, tree vectype_in, - tree *decl1 ATTRIBUTE_UNUSED, - tree *decl2 ATTRIBUTE_UNUSED, enum tree_code *code1, enum tree_code *code2, int *multi_step_cvt, VEC (tree, heap) **interm_types) @@ -6339,8 +6332,8 @@ supportable_widening_operation (enum tree_code code, gimple stmt, && !nested_in_vect_loop_p (vect_loop, stmt) && supportable_widening_operation (VEC_WIDEN_MULT_EVEN_EXPR, stmt, vectype_out, vectype_in, - NULL, NULL, code1, code2, - multi_step_cvt, interm_types)) + code1, code2, multi_step_cvt, + interm_types)) return true; c1 = VEC_WIDEN_MULT_LO_EXPR; c2 = VEC_WIDEN_MULT_HI_EXPR; diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 6b74bb4..3d23107 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -895,9 +895,8 @@ extern bool vect_is_simple_use_1 (tree, gimple, loop_vec_info, bb_vec_info, gimple *, tree *, enum vect_def_type *, tree *); extern bool supportable_widening_operation (enum tree_code, gimple, tree, tree, - tree *, tree *, enum tree_code *, - enum tree_code *, int *, - VEC (tree, heap) **); + enum tree_code *, enum tree_code *, + int *, VEC (tree, heap) **); extern bool supportable_narrowing_operation (enum tree_code, tree, tree, enum tree_code *, int *, VEC (tree, heap) **);