From patchwork Fri Jul 15 04:47:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 72065 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp418351qga; Thu, 14 Jul 2016 21:48:11 -0700 (PDT) X-Received: by 10.67.8.69 with SMTP id di5mr28243164pad.123.1468558091047; Thu, 14 Jul 2016 21:48:11 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 1si6956427pau.29.2016.07.14.21.48.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 21:48:11 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-431723-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-431723-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-431723-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=DzAWPAuKhMPx/dN6K gVBh1BGRGXVIRX+LTuhn/lCHpQ5BuXQodBAfBXm83j0pmXNuoEf/QkKLU+vWidqb T2ZTvyb6HAw/3MIxHxI0He8cGqJOXukEswp5SL98xeo7k0Y3fkHC6QJWyD62XZ1X t5isdpwFNEZVCjTpQUpyfNB5kU= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=M87FLiOHmEgl0chf/jQ+0R8 tY/M=; b=PqAY+din1fqLky4IVdkCKTeTwn6NFjhanipqbKPNh7kESNmsJrxg1lD 7yuxIxFXByAqCdbdXAv0ljiaLSKe76I9jnb2XjdlIN/E0e9rV5GFz9h7/acbEsEH 22GtsoWz5B51lAz0JHQZU2BflVjynthUbdf6dOsoB6nPdLMpiJO4= Received: (qmail 110427 invoked by alias); 15 Jul 2016 04:47:57 -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 110415 invoked by uid 89); 15 Jul 2016 04:47:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f50.google.com Received: from mail-wm0-f50.google.com (HELO mail-wm0-f50.google.com) (74.125.82.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 15 Jul 2016 04:47:46 +0000 Received: by mail-wm0-f50.google.com with SMTP id o80so12919325wme.1 for ; Thu, 14 Jul 2016 21:47:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=hUT/sV1eGU/OTpF1ch2vB/rMamHKnfkG37h9veESH2E=; b=H8mD0Re8zy5r5F3/FGZk574FfTv8rNFmXpo6ltLvrtMdhtiKsYbMho/jhqFqpxlt+0 uGIuOD1lQUaB4bpproGAq9qqc5GOl2c0odU6S5R9s5oY8iev5ElayMYreSzEan5SsJw0 XOA5W89D2y/YQU25bNHb51g/gCRE6x98wp3NsoJnrTi1N42XWuHUJNgD7mCTRBqUhYZm lwTAsVJkC9gZK2EDIIYeY59Ksay0MHSZv0ByTYWiabfpbPr220XU/o0MdZN4uu/PcLpv mNLvtb0IMcx90Xjx2+VGgvFM/L6CkjV3E0Dy0kARIeiriCqVA+8gWUBHO60hIIMsH4Xu 4CSw== X-Gm-Message-State: ALyK8tILakAph9Y0eG0z/bWR3HsKDONeMb27BUmGQhIaPmEO/1/EOJbu4KPWCj7w4NN2OA7y X-Received: by 10.28.152.66 with SMTP id a63mr9103589wme.66.1468558063236; Thu, 14 Jul 2016 21:47:43 -0700 (PDT) Received: from [192.168.207.67] ([62.28.188.194]) by smtp.gmail.com with ESMTPSA id m5sm39326wmm.10.2016.07.14.21.47.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 21:47:42 -0700 (PDT) Subject: [RFC][IPA-VRP] Teach tree-vrp to use the VR set in params To: "gcc-patches@gcc.gnu.org" References: <57886949.8010300@linaro.org> Cc: Richard Biener , Jan Hubicka , Martin Jambor From: kugan Message-ID: <57886AEC.5000603@linaro.org> Date: Fri, 15 Jul 2016 14:47:40 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <57886949.8010300@linaro.org> X-IsSubscribed: yes Hi, This patch teaches tree-vrp to use the VR set in params. Thanks, Kugan gcc/ChangeLog: 2016-07-14 Kugan Vivekanandarajah * tree-vrp.c (get_value_range): Teach PARM_DECL to use ipa-vrp results. >From 1900ff9210f1dd673f815b3a421c6ec1e02f6e05 Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandarajah Date: Thu, 14 Jul 2016 19:28:10 +1000 Subject: [PATCH 6/6] Teach tree-vrp to use ipa-vrp results --- gcc/tree-vrp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 8c87c06..ad3891c 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -667,6 +667,20 @@ get_value_range (const_tree var) if (POINTER_TYPE_P (TREE_TYPE (sym)) && nonnull_arg_p (sym)) set_value_range_to_nonnull (vr, TREE_TYPE (sym)); + else if (!POINTER_TYPE_P (TREE_TYPE (sym))) + { + wide_int min, max; + value_range_type rtype = get_range_info (var, &min, &max); + if (rtype == VR_RANGE || rtype == VR_ANTI_RANGE) + { + vr->type = rtype; + vr->min = wide_int_to_tree (TREE_TYPE (var), min); + vr->max = wide_int_to_tree (TREE_TYPE (var), max); + vr->equiv = NULL; + } + else + set_value_range_to_varying (vr); + } else set_value_range_to_varying (vr); } -- 1.9.1