From patchwork Sat Oct 25 10:16:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 403026 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 20A89140096 for ; Sat, 25 Oct 2014 21:16:58 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=GfO80E8xlfgY4SF9w/CS4YMxO9uW4vPlBCZYRNuZ6kZRmUxv/Q QPHiniqDr/jCpm266fjkTmtJQiTV+/Kk4oQKdCD6lVVZ/bsNA3vm68MbvMc1soH/ HcbbL+zhs4VNwWd2mlARdASce2i4lIpII7gnlzdUB0P3hj3SztKTyWDZA= 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:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=95HZSGbtfQotawyYdMQfDjmE1dY=; b=u5snw6k9kZ+0V4XCCJMZ ryvhJKBeWU19KvCHJ7Pf/NF8ySVHUhfM8NS+X8ImUs0w7oNJ837x+kZb5DyW3WGy 833AVXESDKY8944W9aOLoggYaKg4ltKt68Li0bl/z1XTzvpT8SdfA5oDugQe7mqB aL7nYB861gZ8WSVztrxX0CE= Received: (qmail 26086 invoked by alias); 25 Oct 2014 10:16:51 -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 26076 invoked by uid 89); 25 Oct 2014 10:16:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f175.google.com Received: from mail-wi0-f175.google.com (HELO mail-wi0-f175.google.com) (209.85.212.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 25 Oct 2014 10:16:49 +0000 Received: by mail-wi0-f175.google.com with SMTP id h11so950059wiw.8 for ; Sat, 25 Oct 2014 03:16:46 -0700 (PDT) X-Received: by 10.180.126.9 with SMTP id mu9mr9835964wib.38.1414232206823; Sat, 25 Oct 2014 03:16:46 -0700 (PDT) Received: from localhost ([95.144.14.167]) by mx.google.com with ESMTPSA id p2sm4712387wiy.1.2014.10.25.03.16.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Oct 2014 03:16:46 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rth@redhat.com, rdsandiford@googlemail.com Cc: rth@redhat.com Subject: [alpha] RFA: Use new rtl iterators in some_small_symbolic_operand_int Date: Sat, 25 Oct 2014 11:16:45 +0100 Message-ID: <8738acv4he.fsf@googlemail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 This is part of a series to remove uses of for_each_rtx from the ports. Tested by making sure there were no code changes for gcc.dg, gcc.c-torture and g++.dg for alpha-linux-gnu. OK to install? Thanks, Richard gcc/ * config/alpha/alpha-protos.h (some_small_symbolic_operand_int): Take an rtx and return a bool. * config/alpha/alpha.c (some_small_symbolic_operand_int): Likewise. Use FOR_EACH_SUBRTX_VAR. * config/alpha/predicates.md (some_small_symbolic_operand): Update accordingly. Index: gcc/config/alpha/alpha-protos.h =================================================================== --- gcc/config/alpha/alpha-protos.h 2014-10-25 09:51:29.781922193 +0100 +++ gcc/config/alpha/alpha-protos.h 2014-10-25 09:51:30.191925847 +0100 @@ -112,6 +112,6 @@ extern HOST_WIDE_INT alpha_vms_initial_e extern rtx unicosmk_add_call_info_word (rtx); -extern int some_small_symbolic_operand_int (rtx *, void *); +extern bool some_small_symbolic_operand_int (rtx); extern int tls_symbolic_operand_1 (rtx, int, int); extern rtx resolve_reload_operand (rtx); Index: gcc/config/alpha/alpha.c =================================================================== --- gcc/config/alpha/alpha.c 2014-10-25 09:51:29.783922210 +0100 +++ gcc/config/alpha/alpha.c 2014-10-25 09:51:30.192925856 +0100 @@ -1225,16 +1225,20 @@ alpha_function_ok_for_sibcall (tree decl return decl_has_samegp (decl); } -int -some_small_symbolic_operand_int (rtx *px, void *data ATTRIBUTE_UNUSED) +bool +some_small_symbolic_operand_int (rtx x) { - rtx x = *px; - - /* Don't re-split. */ - if (GET_CODE (x) == LO_SUM) - return -1; - - return small_symbolic_operand (x, Pmode) != 0; + subrtx_var_iterator::array_type array; + FOR_EACH_SUBRTX_VAR (iter, array, x, ALL) + { + rtx x = *iter; + /* Don't re-split. */ + if (GET_CODE (x) == LO_SUM) + iter.skip_subrtxes (); + else if (small_symbolic_operand (x, Pmode)) + return true; + } + return false; } rtx Index: gcc/config/alpha/predicates.md =================================================================== --- gcc/config/alpha/predicates.md 2014-10-25 09:40:37.750514758 +0100 +++ gcc/config/alpha/predicates.md 2014-10-25 09:51:30.193925865 +0100 @@ -638,7 +638,7 @@ (define_predicate "some_small_symbolic_o /* Avoid search unless necessary. */ if (!TARGET_EXPLICIT_RELOCS || !reload_completed) return false; - return for_each_rtx (&op, some_small_symbolic_operand_int, NULL); + return some_small_symbolic_operand_int (op); }) ;; Accept a register, or a memory if BWX is enabled.