From patchwork Wed Oct 5 17:20:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 117898 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 D9992B6FA5 for ; Thu, 6 Oct 2011 04:21:12 +1100 (EST) Received: (qmail 26535 invoked by alias); 5 Oct 2011 17:21:10 -0000 Received: (qmail 26526 invoked by uid 22791); 5 Oct 2011 17:21:08 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_ZJ, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Oct 2011 17:20:52 +0000 Received: by yxj17 with SMTP id 17so2034695yxj.20 for ; Wed, 05 Oct 2011 10:20:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.77.233 with SMTP id d69mr14951648yhe.84.1317835251151; Wed, 05 Oct 2011 10:20:51 -0700 (PDT) Received: by 10.147.116.13 with HTTP; Wed, 5 Oct 2011 10:20:51 -0700 (PDT) Date: Wed, 5 Oct 2011 19:20:51 +0200 Message-ID: Subject: [PATCH, i386]: A couple of cleanups. From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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 Hello! No functional change. 2011-10-05 Uros Bizjak * config/i386/i386.c (distance_non_agu_define): Simplify calculation of "found". Simplify return value calculation. (distance_agu_use): Ditto. Tested on x86_64-pc-linux-gnu {,-m32} with shrink-wrapping disabled, committed to mainline SVN. Uros. Index: i386.c =================================================================== --- i386.c (revision 179558) +++ i386.c (working copy) @@ -16139,19 +16139,20 @@ distance_non_agu_define (unsigned int regno1, unsi FOR_EACH_EDGE (e, ei, bb->preds) { - int bb_dist = distance_non_agu_define_in_bb (regno1, regno2, - insn, distance, - BB_END (e->src), - &found_in_bb); + int bb_dist + = distance_non_agu_define_in_bb (regno1, regno2, + insn, distance, + BB_END (e->src), + &found_in_bb); if (found_in_bb) { if (shortest_dist < 0) shortest_dist = bb_dist; else if (bb_dist > 0) shortest_dist = MIN (bb_dist, shortest_dist); - } - found = found || found_in_bb; + found = true; + } } distance = shortest_dist; @@ -16164,11 +16165,9 @@ distance_non_agu_define (unsigned int regno1, unsi extract_insn_cached (insn); if (!found) - distance = -1; - else - distance = distance >> 1; + return -1; - return distance; + return distance >> 1; } /* Return the distance in half-cycles between INSN and the next @@ -16181,9 +16180,9 @@ distance_non_agu_define (unsigned int regno1, unsi found and false otherwise. */ static int -distance_agu_use_in_bb(unsigned int regno, - rtx insn, int distance, rtx start, - bool *found, bool *redefined) +distance_agu_use_in_bb (unsigned int regno, + rtx insn, int distance, rtx start, + bool *found, bool *redefined) { basic_block bb = start ? BLOCK_FOR_INSN (start) : NULL; rtx next = start; @@ -16268,18 +16267,19 @@ distance_agu_use (unsigned int regno0, rtx insn) FOR_EACH_EDGE (e, ei, bb->succs) { - int bb_dist = distance_agu_use_in_bb (regno0, insn, - distance, BB_HEAD (e->dest), - &found_in_bb, &redefined_in_bb); + int bb_dist + = distance_agu_use_in_bb (regno0, insn, + distance, BB_HEAD (e->dest), + &found_in_bb, &redefined_in_bb); if (found_in_bb) { if (shortest_dist < 0) shortest_dist = bb_dist; else if (bb_dist > 0) shortest_dist = MIN (bb_dist, shortest_dist); - } - found = found || found_in_bb; + found = true; + } } distance = shortest_dist; @@ -16287,11 +16287,9 @@ distance_agu_use (unsigned int regno0, rtx insn) } if (!found || redefined) - distance = -1; - else - distance = distance >> 1; + return -1; - return distance; + return distance >> 1; } /* Define this macro to tune LEA priority vs ADD, it take effect when @@ -16346,7 +16344,7 @@ ix86_lea_outperforms (rtx insn, unsigned int regno false otherwise. */ static bool -ix86_ok_to_clobber_flags(rtx insn) +ix86_ok_to_clobber_flags (rtx insn) { basic_block bb = BLOCK_FOR_INSN (insn); df_ref *use;