From patchwork Mon Nov 25 11:24:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 293888 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5D17D2C0126 for ; Mon, 25 Nov 2013 22:24:50 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=CKzS416ZDgBpB+cqBI 4zBFgixsBZtjCm6IFrq678Gfvr+5vyUGx5ET8x2YWbSTQn2ULWtsJczuKbkwxil1 ELVNFL5c9QPuhwrLCVD946CbAKNHL/RZFhHvUhkbC5XFdl+2jWpkj/x3amAb0Fri r+dQRVpM6C+UzptqPmI0Tmmik= 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 :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=vhZM4f+IJcVCtxj+Wbe9jpCn KNE=; b=ydpfBsWWKqdaxLxzzVnS5Vr/iYZlD5GzlAAWovjr7XVK6YUSqGi7Gh6k QRWZVz55IgFH5IE/CHJbvKLc89Vt0xIFZGVwtktIhChgGmb1qGBbEqD1ANX7gTAP 5Z1bM1KF1FrML2+GHDLCUcR6zT3WGHgHL6eqZjXMdcrlBeRBPKg= Received: (qmail 13796 invoked by alias); 25 Nov 2013 11:24:41 -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 13783 invoked by uid 89); 25 Nov 2013 11:24:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RDNS_NONE, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-wg0-f54.google.com Received: from Unknown (HELO mail-wg0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 25 Nov 2013 11:24:39 +0000 Received: by mail-wg0-f54.google.com with SMTP id n12so2636815wgh.33 for ; Mon, 25 Nov 2013 03:24:30 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.180.185.179 with SMTP id fd19mr13172964wic.18.1385378670529; Mon, 25 Nov 2013 03:24:30 -0800 (PST) Received: by 10.195.12.114 with HTTP; Mon, 25 Nov 2013 03:24:30 -0800 (PST) In-Reply-To: <6B2EE613-1012-4B93-82A4-B0DEC2639301@comcast.net> References: <6B2EE613-1012-4B93-82A4-B0DEC2639301@comcast.net> Date: Mon, 25 Nov 2013 12:24:30 +0100 Message-ID: Subject: Re: wide-int, gimple From: Richard Biener To: Mike Stump Cc: "gcc-patches@gcc.gnu.org Patches" , Jakub Jelinek , Kenneth Zadeck X-IsSubscribed: yes On Sat, Nov 23, 2013 at 8:21 PM, Mike Stump wrote: > Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch. This patch covers the gimple code. > > Ok? @@ -1754,7 +1754,7 @@ dump_ssaname_info (pretty_printer *buffer, tree node, int spc) if (!POINTER_TYPE_P (TREE_TYPE (node)) && SSA_NAME_RANGE_INFO (node)) { - double_int min, max, nonzero_bits; + widest_int min, max, nonzero_bits; value_range_type range_type = get_range_info (node, &min, &max); if (range_type == VR_VARYING) this makes me suspect you are changing SSA_NAME_RANGE_INFO to embed two max wide_ints. That's a no-no. that's similarly excessive. You've said widest_int is only for automatic use (thus, stack allocated). Yet they sneak in into basic structures of optimization passes ... The above is a case where a pass should decide on a limit. For SLSR an offset_int is appropriate (but yes, you then need to retain or even add checks whether uses fit). In some cases making wide_int the trailing element in pass local data can allow for more optimal dynamic allocation as well. @@ -831,9 +831,17 @@ gimple_divmod_fixed_value_transform (gimple_stmt_iterator *si) else prob = 0; - tree_val = build_int_cst_wide (get_gcov_type (), - (unsigned HOST_WIDE_INT) val, - val >> (HOST_BITS_PER_WIDE_INT - 1) >> 1); + if (sizeof (gcov_type) == sizeof (HOST_WIDE_INT)) + tree_val = build_int_cst (get_gcov_type (), val); + else + { + HOST_WIDE_INT a[2]; + a[0] = (unsigned HOST_WIDE_INT) val; + a[1] = val >> (HOST_BITS_PER_WIDE_INT - 1) >> 1; + + tree_val = wide_int_to_tree (get_gcov_type (), wide_int::from_array (a, 2, + TYPE_PRECISION (get_gcov_type ()), false)); + } is two times replicated. Please add a build_int_cst overload for HOST_WIDEST_INT instead (conditional on HOST_WIDEST_INT != HOST_WIDE_INT). Thanks, Richard. diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index 3ac9e4d..b9fc936 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -239,7 +240,7 @@ struct slsr_cand_d tree stride; /* The index constant i. */ - double_int index; + widest_int index; /* The type of the candidate. This is normally the type of base_expr, but casts may have occurred when combining feeding instructions. @@ -314,7 +315,7 @@ typedef const struct cand_chain_d *const_cand_chain_t; struct incr_info_d { /* The increment that relates a candidate to its basis. */ - double_int incr; + widest_int incr; /* How many times the increment occurs in the candidate tree. */ unsigned count;