From patchwork Tue Aug 9 10:32:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Clifton X-Patchwork-Id: 109190 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]) by ozlabs.org (Postfix) with SMTP id 7AEE6B6F84 for ; Tue, 9 Aug 2011 20:31:58 +1000 (EST) Received: (qmail 14831 invoked by alias); 9 Aug 2011 10:31:56 -0000 Received: (qmail 14820 invoked by uid 22791); 9 Aug 2011 10:31:55 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Aug 2011 10:31:38 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p79AVbLE006663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Aug 2011 06:31:37 -0400 Received: from Gift.redhat.com (vpn1-5-36.ams2.redhat.com [10.36.5.36]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p79AVXJ3004096 for ; Tue, 9 Aug 2011 06:31:36 -0400 From: Nick Clifton To: gcc-patches@gcc.gnu.org Subject: Commit: RX: Disable extender peepholes at -O3 Date: Tue, 09 Aug 2011 11:32:58 +0100 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes 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 Hi Guys, I am checking in the patch below to the mainline and 4.6 branch. It disables the peephole optimizations in the rx.md file that combine a load followed by a zero- or sign- extend operation. The disabling only happens at -O3 (or higher) as although the peepholes reduce the number of instructions they can introduce pipeline stalls that actually make the program slower. (This is certainly true for the coremark test). Cheers Nick gcc/ChangeLog 2011-08-09 Nick Clifton * config/rx/rx.md: Disable extender peepholes at -O3. Index: gcc/config/rx/rx.md =================================================================== --- gcc/config/rx/rx.md (revision 177584) +++ gcc/config/rx/rx.md (working copy) @@ -1598,7 +1598,7 @@ (memex_commutative:SI (match_dup 0) (match_dup 2))) (clobber (reg:CC CC_REG))])] - "peep2_regno_dead_p (2, REGNO (operands[0]))" + "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)" [(parallel [(set:SI (match_dup 2) (memex_commutative:SI (match_dup 2) (extend_types:SI (match_dup 1)))) @@ -1612,7 +1612,7 @@ (memex_commutative:SI (match_dup 2) (match_dup 0))) (clobber (reg:CC CC_REG))])] - "peep2_regno_dead_p (2, REGNO (operands[0]))" + "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)" [(parallel [(set:SI (match_dup 2) (memex_commutative:SI (match_dup 2) (extend_types:SI (match_dup 1)))) @@ -1626,7 +1626,7 @@ (memex_noncomm:SI (match_dup 2) (match_dup 0))) (clobber (reg:CC CC_REG))])] - "peep2_regno_dead_p (2, REGNO (operands[0]))" + "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)" [(parallel [(set:SI (match_dup 2) (memex_noncomm:SI (match_dup 2) (extend_types:SI (match_dup 1)))) @@ -1639,7 +1639,7 @@ (set (match_operand:SI 2 "register_operand") (memex_nocc:SI (match_dup 0) (match_dup 2)))] - "peep2_regno_dead_p (2, REGNO (operands[0]))" + "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)" [(set:SI (match_dup 2) (memex_nocc:SI (match_dup 2) (extend_types:SI (match_dup 1))))] @@ -1651,7 +1651,7 @@ (set (match_operand:SI 2 "register_operand") (memex_nocc:SI (match_dup 2) (match_dup 0)))] - "peep2_regno_dead_p (2, REGNO (operands[0]))" + "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)" [(set:SI (match_dup 2) (memex_nocc:SI (match_dup 2) (extend_types:SI (match_dup 1))))] @@ -1662,7 +1662,7 @@ (memex_commutative:SI (match_operand:SI 1 "register_operand" "%0") (extend_types:SI (match_operand:small_int_modes 2 "rx_restricted_mem_operand" "Q")))) (clobber (reg:CC CC_REG))] - "" + "(optimize < 3 || optimize_size)" "\t%2, %0" [(set_attr "timings" "33") (set_attr "length" "5")] ;; This length is corrected in rx_adjust_insn_length @@ -1673,7 +1673,7 @@ (memex_noncomm:SI (match_operand:SI 1 "register_operand" "0") (extend_types:SI (match_operand:small_int_modes 2 "rx_restricted_mem_operand" "Q")))) (clobber (reg:CC CC_REG))] - "" + "(optimize < 3 || optimize_size)" "\t%2, %0" [(set_attr "timings" "33") (set_attr "length" "5")] ;; This length is corrected in rx_adjust_insn_length @@ -1683,7 +1683,7 @@ [(set (match_operand:SI 0 "register_operand" "=r") (memex_nocc:SI (match_operand:SI 1 "register_operand" "%0") (extend_types:SI (match_operand:small_int_modes 2 "rx_restricted_mem_operand" "Q"))))] - "" + "(optimize < 3 || optimize_size)" "\t%2, %0" [(set_attr "timings" "33") (set_attr "length" "5")] ;; This length is corrected in rx_adjust_insn_length @@ -1695,7 +1695,7 @@ (set (reg:CC CC_REG) (compare:CC (match_operand:SI 2 "register_operand") (match_dup 0)))] - "peep2_regno_dead_p (2, REGNO (operands[0]))" + "peep2_regno_dead_p (2, REGNO (operands[0])) && (optimize < 3 || optimize_size)" [(set (reg:CC CC_REG) (compare:CC (match_dup 2) (extend_types:SI (match_dup 1))))] @@ -1734,7 +1734,7 @@ [(set (reg:CC CC_REG) (compare:CC (match_operand:SI 0 "register_operand" "=r") (extend_types:SI (match_operand:small_int_modes 1 "rx_restricted_mem_operand" "Q"))))] - "" + "(optimize < 3 || optimize_size)" "cmp\t%1, %0" [(set_attr "timings" "33") (set_attr "length" "5")] ;; This length is corrected in rx_adjust_insn_length