From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27715 invoked by alias); 13 Jul 2017 08:54:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 26262 invoked by uid 89); 13 Jul 2017 08:54:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm0-f45.google.com Received: from mail-wm0-f45.google.com (HELO mail-wm0-f45.google.com) (74.125.82.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jul 2017 08:54:11 +0000 Received: by mail-wm0-f45.google.com with SMTP id f67so18352679wmh.1 for ; Thu, 13 Jul 2017 01:54:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=/ykRtvuc2VGj8D/cCXkg03wFNUGwD44jx4airOrf/8o=; b=ccPQKGycUv+UVw02jDGyyw5wuWhSyF2pXK/jsfsE4PYo9DJgDeDVP2rjcmWYdWEABu 5DONr9xv5dB+/lfh8pzz5kdgM9tZ6ukBwDylx7Wj6PtCEcbvFJBnxIkxLky/vPA32m9q zxWiGK+xvrL4OG3mYFhg/4DKR2/GhLWjvWWmmt6QTuhL/0nIDl014otUs8jDthQ6shRH gYeKNXsVeMyeid3Cj6N2uCXQ0E+6qS9InR+f/HGrJ9kgmCyV13d+L8dKOUS+xySU+chl xqZQcyHrkgYh4AbGD44sB84n5W/Gj/LODxthciicQMqCn/8gtyYUNtaVVV9W1Rkj6346 mhSQ== X-Gm-Message-State: AIVw110vefzjg5FYqIUc/OrGm5rpLHdM+ADSLOZ4tbDHgOZ0dcNCEOe4 iw9I5W9KF+VfBV5JORy5/A== X-Received: by 10.28.143.10 with SMTP id r10mr1263771wmd.10.1499936049141; Thu, 13 Jul 2017 01:54:09 -0700 (PDT) Received: from localhost (92.40.249.184.threembb.co.uk. [92.40.249.184]) by smtp.gmail.com with ESMTPSA id t125sm4956677wmt.20.2017.07.13.01.54.08 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 01:54:08 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [44/77] Make simplify_and_const_int take a scalar_int_mode References: <8760ewohsv.fsf@linaro.org> Date: Thu, 13 Jul 2017 08:54:00 -0000 In-Reply-To: <8760ewohsv.fsf@linaro.org> (Richard Sandiford's message of "Thu, 13 Jul 2017 09:35:44 +0100") Message-ID: <87vamwg1jl.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-07/txt/msg00684.txt.bz2 After previous patches, top-level calls to simplify_and_const_int always pass a scalar_int_mode. The only call site that needs to be updated is the recursive one in simplify_and_const_int_1, at which point we know "varop" has a scalar integer mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * combine.c (simplify_and_const_int): Change the type of the mode parameter to scalar_int_mode. (simplify_and_const_int_1): Likewise. Update recursive call. Index: gcc/combine.c =================================================================== --- gcc/combine.c 2017-07-13 09:18:43.379419324 +0100 +++ gcc/combine.c 2017-07-13 09:18:43.779386786 +0100 @@ -459,9 +459,9 @@ static int rtx_equal_for_field_assignmen static rtx make_field_assignment (rtx); static rtx apply_distributive_law (rtx); static rtx distribute_and_simplify_rtx (rtx, int); -static rtx simplify_and_const_int_1 (machine_mode, rtx, +static rtx simplify_and_const_int_1 (scalar_int_mode, rtx, unsigned HOST_WIDE_INT); -static rtx simplify_and_const_int (rtx, machine_mode, rtx, +static rtx simplify_and_const_int (rtx, scalar_int_mode, rtx, unsigned HOST_WIDE_INT); static int merge_outer_ops (enum rtx_code *, HOST_WIDE_INT *, enum rtx_code, HOST_WIDE_INT, machine_mode, int *); @@ -9927,7 +9927,7 @@ distribute_and_simplify_rtx (rtx x, int (const_int CONSTOP)). Otherwise, return NULL_RTX. */ static rtx -simplify_and_const_int_1 (machine_mode mode, rtx varop, +simplify_and_const_int_1 (scalar_int_mode mode, rtx varop, unsigned HOST_WIDE_INT constop) { unsigned HOST_WIDE_INT nonzero; @@ -9987,19 +9987,20 @@ simplify_and_const_int_1 (machine_mode m won't match a pattern either with or without this. */ if (GET_CODE (varop) == IOR || GET_CODE (varop) == XOR) - return - gen_lowpart - (mode, - apply_distributive_law - (simplify_gen_binary (GET_CODE (varop), GET_MODE (varop), - simplify_and_const_int (NULL_RTX, - GET_MODE (varop), - XEXP (varop, 0), - constop), - simplify_and_const_int (NULL_RTX, - GET_MODE (varop), - XEXP (varop, 1), - constop)))); + { + scalar_int_mode varop_mode = as_a (GET_MODE (varop)); + return + gen_lowpart + (mode, + apply_distributive_law + (simplify_gen_binary (GET_CODE (varop), varop_mode, + simplify_and_const_int (NULL_RTX, varop_mode, + XEXP (varop, 0), + constop), + simplify_and_const_int (NULL_RTX, varop_mode, + XEXP (varop, 1), + constop)))); + } /* If VAROP is PLUS, and the constant is a mask of low bits, distribute the AND and see if one of the operands simplifies to zero. If so, we @@ -10042,7 +10043,7 @@ simplify_and_const_int_1 (machine_mode m X is zero, we are to always construct the equivalent form. */ static rtx -simplify_and_const_int (rtx x, machine_mode mode, rtx varop, +simplify_and_const_int (rtx x, scalar_int_mode mode, rtx varop, unsigned HOST_WIDE_INT constop) { rtx tem = simplify_and_const_int_1 (mode, varop, constop);