From patchwork Thu Nov 15 21:54:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 199447 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 3BDA52C04B2 for ; Fri, 16 Nov 2012 08:59:05 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1353621545; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Date:To:Subject:User-Agent: MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id: From:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=Tc7fLNC eDuD8xpRhsCYkVil7phc=; b=Juo3RMz1hnMgi9uV8CimltSINAY/B/8IXZzgWsW zlcLiFwxS+D6ofL6tr4YJIrBG6bpA5fTVlYUNeIqjR7JhRx9RE1uVkpn67vv6hWP PI2g0N09CGCkfOs4JDpa3OMPQc65++/ONhFXJR7g4HuLZWt5F/fQgQ4PTK3cZKyo uGAg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:Received:Date:To:Subject:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Q0AgQe7AyFNpJOgxDr7vMGiJ107BSRR5lEFVrMYnAa/UfwPbeNOd+4tz/Wbhrx 3haRhUVLqjFaYX2ycvtZsvpx0eWUIIOzA7xfJCr83rjBXrHTyUNI3OGejJfSiTZ3 AL6sS/lPnfIw3RFnobSA5plwG1KCcds5bkfZot2VOahMw=; Received: (qmail 13581 invoked by alias); 15 Nov 2012 21:55:05 -0000 Received: (qmail 11872 invoked by uid 22791); 15 Nov 2012 21:54:41 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-lb0-f201.google.com (HELO mail-lb0-f201.google.com) (209.85.217.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Nov 2012 21:54:36 +0000 Received: by mail-lb0-f201.google.com with SMTP id m4so138830lbo.2 for ; Thu, 15 Nov 2012 13:54:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:to:subject:user-agent:mime-version:content-type :content-transfer-encoding:message-id:from:x-gm-message-state; bh=pDYvu0Wfxnu9HQMXqY/4wXH0Heu0Eg+tD8pOZbZMBjA=; b=bo/vsp38xhiFg9OxY8AYCX0wZ3v3FdV98jqHqlPncSJhoriBgBlILZwb7wdK7HFgrg YaKtXIj9MGkht4bDofSuAjC2cxjeZUIkt3yIDwaF7I8SafiFFoYS+hzKI1sb+aTPLFKH aL/yu9Q6Wv2DCt3jRsNkOAaJzwjrlZ24Urc2/S9OVqrSqmQOhmAyz+hbzwhBSgvknXl0 nGpXGw/an+Kc6VER1KnYH1bhCLfcoNo+WgkKytF8UbkMPsz/INYt8QaWH+ujyovwFRbv dZKMTtdCYM0dYXyQMHCRg07dYKfWqU1xrD6sGwHMHJIC3FEp8K7desnBvqJQ5xtEVq9t JOSw== Received: by 10.14.199.6 with SMTP id w6mr3317536een.0.1353016474546; Thu, 15 Nov 2012 13:54:34 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id u8si4117427een.1.2012.11.15.13.54.34 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 15 Nov 2012 13:54:34 -0800 (PST) Received: from torture.tor.corp.google.com (torture.tor.corp.google.com [172.30.222.16]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 40A3D2000EE; Thu, 15 Nov 2012 13:54:34 -0800 (PST) Received: by torture.tor.corp.google.com (Postfix, from userid 54752) id B3EBCC0916; Thu, 15 Nov 2012 16:54:33 -0500 (EST) Date: Thu, 15 Nov 2012 16:54:33 -0500 To: joern.rennecke@embecosm.com, gcc-patches@gcc.gnu.org Subject: VEC re-write [patch 25/25] User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-Id: <20121115215433.B3EBCC0916@torture.tor.corp.google.com> From: dnovillo@google.com (Diego Novillo) X-Gm-Message-State: ALoCoQl6unxf31I8p+GLl+0fG1onWWoNEKPgXsQsFur+f+10Ty3hYrEyxqT1lM8vwLy67gKahiF2VnxW63inj+xqMXuQz06YibTNBkMai0Jy3rwPZ8SU8yqpkweZsnraqDDgYsBxQNyV5Tz/B9d+1AtTHme1A+Z2pGCYOGtc5ERhxfemJ5gOwVeM1u5AUjKzQ/AQJO3xDvc8 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 2012-11-15 Diego Novillo Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * epiphany/resolve-sw-modes.c: Use new vec API in vec.h. diff --git a/gcc/config/epiphany/resolve-sw-modes.c b/gcc/config/epiphany/resolve-sw-modes.c index ec0dfcc..9704553 100644 --- a/gcc/config/epiphany/resolve-sw-modes.c +++ b/gcc/config/epiphany/resolve-sw-modes.c @@ -56,12 +56,12 @@ resolve_sw_modes (void) { basic_block bb; rtx insn, src; - VEC (basic_block, heap) *todo; + vec todo; sbitmap pushed; bool need_commit = false; bool finalize_fp_sets = (MACHINE_FUNCTION (cfun)->unknown_mode_sets == 0); - todo = VEC_alloc (basic_block, heap, last_basic_block); + todo.create (last_basic_block); pushed = sbitmap_alloc (last_basic_block); bitmap_clear (pushed); if (!finalize_fp_sets) @@ -98,7 +98,7 @@ resolve_sw_modes (void) checking the total frequency of the affected edges. */ selected_mode = (enum attr_fp_mode) epiphany_normal_fp_rounding; - VEC_quick_push (basic_block, todo, bb); + todo.quick_push (bb); bitmap_set_bit (pushed, bb->index); } XVECEXP (XEXP (src, 0), 0, 0) = GEN_INT (selected_mode); @@ -106,9 +106,9 @@ resolve_sw_modes (void) SET_SRC (XVECEXP (PATTERN (insn), 0, 2)) = copy_rtx (src); df_insn_rescan (insn); } - while (VEC_length (basic_block, todo)) + while (todo.length ()) { - basic_block bb = VEC_pop (basic_block, todo); + basic_block bb = todo.pop (); int selected_reg, jilted_reg; enum attr_fp_mode jilted_mode; edge e; @@ -141,7 +141,7 @@ resolve_sw_modes (void) { if (bitmap_bit_p (pushed, succ->index)) continue; - VEC_quick_push (basic_block, todo, succ); + todo.quick_push (succ); bitmap_set_bit (pushed, bb->index); continue; } @@ -154,7 +154,7 @@ resolve_sw_modes (void) insert_insn_on_edge (seq, e); } } - VEC_free (basic_block, heap, todo); + todo.release (); sbitmap_free (pushed); if (need_commit) commit_edge_insertions ();