From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18928 invoked by alias); 6 Aug 2014 17:42:17 -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 18880 invoked by uid 89); 6 Aug 2014 17:42:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 06 Aug 2014 17:42:15 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF4uZ-0001nM-Ii for gcc-patches@gcc.gnu.org; Wed, 06 Aug 2014 13:22:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF4uZ-0001nG-Ch for gcc-patches@gcc.gnu.org; Wed, 06 Aug 2014 13:22:03 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s76HL2JO006195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Aug 2014 13:21:03 -0400 Received: from c64.redhat.com (vpn-239-139.phx2.redhat.com [10.3.239.139]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s76HJ2r3030913; Wed, 6 Aug 2014 13:21:02 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 207/236] reorg.c: Use rtx_sequence Date: Wed, 06 Aug 2014 17:42:00 -0000 Message-Id: <1407345815-14551-208-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> References: <1407345815-14551-1-git-send-email-dmalcolm@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00635.txt.bz2 gcc/ * reorg.c (redundant_insn): In two places in the function, replace a check of GET_CODE with a dyn_cast, introducing local "seq", and usings methods of rtx_sequence to clarify the code. --- gcc/reorg.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gcc/reorg.c b/gcc/reorg.c index 75819bc..3894863 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -1526,11 +1526,11 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER) continue; - if (GET_CODE (pat) == SEQUENCE) + if (rtx_sequence *seq = dyn_cast (pat)) { /* Stop for a CALL and its delay slots because it is difficult to track its resource needs correctly. */ - if (CALL_P (XVECEXP (pat, 0, 0))) + if (CALL_P (seq->element (0))) return 0; /* Stop for an INSN or JUMP_INSN with delayed effects and its delay @@ -1538,21 +1538,21 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) correctly. */ #ifdef INSN_SETS_ARE_DELAYED - if (INSN_SETS_ARE_DELAYED (XVECEXP (pat, 0, 0))) + if (INSN_SETS_ARE_DELAYED (seq->element (0))) return 0; #endif #ifdef INSN_REFERENCES_ARE_DELAYED - if (INSN_REFERENCES_ARE_DELAYED (XVECEXP (pat, 0, 0))) + if (INSN_REFERENCES_ARE_DELAYED (seq->element (0))) return 0; #endif /* See if any of the insns in the delay slot match, updating resource requirements as we go. */ - for (i = XVECLEN (pat, 0) - 1; i > 0; i--) - if (GET_CODE (XVECEXP (pat, 0, i)) == GET_CODE (insn) - && rtx_equal_p (PATTERN (XVECEXP (pat, 0, i)), ipat) - && ! find_reg_note (XVECEXP (pat, 0, i), REG_UNUSED, NULL_RTX)) + for (i = seq->len () - 1; i > 0; i--) + if (GET_CODE (seq->element (i)) == GET_CODE (insn) + && rtx_equal_p (PATTERN (seq->element (i)), ipat) + && ! find_reg_note (seq->element (i), REG_UNUSED, NULL_RTX)) break; /* If found a match, exit this loop early. */ @@ -1628,10 +1628,10 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER) continue; - if (GET_CODE (pat) == SEQUENCE) + if (rtx_sequence *seq = dyn_cast (pat)) { bool annul_p = false; - rtx control = XVECEXP (pat, 0, 0); + rtx control = seq->element (0); /* If this is a CALL_INSN and its delay slots, it is hard to track the resource needs properly, so give up. */ @@ -1656,9 +1656,9 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) /* See if any of the insns in the delay slot match, updating resource requirements as we go. */ - for (i = XVECLEN (pat, 0) - 1; i > 0; i--) + for (i = seq->len () - 1; i > 0; i--) { - rtx candidate = XVECEXP (pat, 0, i); + rtx candidate = seq->element (i); /* If an insn will be annulled if the branch is false, it isn't considered as a possible duplicate insn. */ -- 1.8.5.3