From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19653 invoked by alias); 24 Aug 2007 04:24:28 -0000 Received: (qmail 19537 invoked by uid 22791); 24 Aug 2007 04:24:27 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Aug 2007 04:24:22 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l7O4OIPN031981; Fri, 24 Aug 2007 00:24:18 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7O4OIxt006195; Fri, 24 Aug 2007 00:24:18 -0400 Received: from free.oliva.athome.lsd.ic.unicamp.br (vpn-14-214.rdu.redhat.com [10.11.14.214]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l7O4OGNf005390; Fri, 24 Aug 2007 00:24:17 -0400 Received: from free.oliva.athome.lsd.ic.unicamp.br (localhost.localdomain [127.0.0.1]) by free.oliva.athome.lsd.ic.unicamp.br (8.14.1/8.13.8) with ESMTP id l7O4ODFH017709; Fri, 24 Aug 2007 01:24:13 -0300 Received: (from aoliva@localhost) by free.oliva.athome.lsd.ic.unicamp.br (8.14.1/8.13.5/Submit) id l7O4OA8k017707; Fri, 24 Aug 2007 01:24:10 -0300 To: Roman Zippel Cc: Bernd Schmidt , Diego Novillo , Daniel Berlin , GCC Patches , Andrew Pinski , Eric Botcazou Subject: SRA bit-field optimization (was: Re: Reload bug & SRA oddness) References: From: Alexandre Oliva Errors-To: aoliva@oliva.athome.lsd.ic.unicamp.br Date: Fri, 24 Aug 2007 07:28:00 -0000 In-Reply-To: (Alexandre Oliva's message of "Fri\, 06 Jul 2007 05\:34\:27 -0300") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 X-SW-Source: 2007-08/txt/msg01614.txt.bz2 On Jul 6, 2007, Alexandre Oliva wrote: > Here's the patch, bootstrapped and regression-tested on > x86_64-linux-gnu and i686-pc-linux-gnu (with an oldish, pre-sccvn > tree, to be able to test ada as well). Tests on ppc-linux-gnu and > ppc64-linux-gnu underway. > Ok to install? Ping? http://gcc.gnu.org/ml/gcc-patches/2007-07/msg00556.html > for gcc/ChangeLog > from Alexandre Oliva > PR middle-end/22156 > * tree-sra.c (struct sra_elt): Add in_bitfld_block. > (sra_hash_tree): Handle BIT_FIELD_REFs. > (sra_elt_hash): Don't hash bitfld blocks. > (sra_elt_eq): Skip them in parent compares as well. Handle > BIT_FIELD_REFs. > (build_element_name_1): Handle BIT_FIELD_REFs. > (instantiate_element): Propagate nowarn from parents. Create > BIT_FIELD_REF for variables that are widened by scalarization. > Gimple-zero-initialize all bit-field variables that are not > part of parameters that are going to be scalarized on entry. > (instantiate_missing_elements_1): Return the sra_elt. > (canon_type_for_field): New. > (try_instantiate_multiple_fields): New. Infer widest possible > access mode from decl or member type, but clip it at word > size, and only widen it if a field crosses an alignment > boundary. > (instantiate_missing_elements): Use them. > (generate_one_element_ref): Handle BIT_FIELD_REFs. > (scalar_bitfield_p): New. > (sra_build_assignment): Optimize assignments from scalarizable > BIT_FIELD_REFs. Use BITS_BIG_ENDIAN to determine shift > counts. > (REPLDUP): New. > (sra_build_bf_assignment): New. Optimize assignments to > scalarizable BIT_FIELD_REFs. > (sra_build_elt_assignment): New. Optimize BIT_FIELD_REF > assignments to full variables. > (generate_copy_inout): Use the new macros and functions. > (generate_element_copy): Likewise. Handle bitfld differences. > (generate_element_zero): Don't recurse for blocks. Use > sra_build_elt_assignment. > (generate_one_element_init): Take elt instead of var. Use > sra_build_elt_assignment. > (generate_element_init_1): Adjust. > (bitfield_overlap_info): New struct. > (bitfield_overlaps_p): New. > (sra_explode_bitfield_assignment): New. Adjust widened > variables to account for endianness. > (sra_sync_for_bitfield_assignment): New. > (scalarize_use): Re-expand assignment to/from scalarized > BIT_FIELD_REFs. Explode or sync needed members for > BIT_FIELD_REFs accesses or assignments. Use REPLDUP. > (scalarize_copy): Use REPLDUP. > (scalarize_ldst): Move assert before dereference. Adjust EH > handling. > (dump_sra_elt_name): Handle BIT_FIELD_REFs. -- Alexandre Oliva http://www.lsd.ic.unicamp.br/~oliva/ FSF Latin America Board Member http://www.fsfla.org/ Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}