From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8157 invoked by alias); 22 Sep 2014 07:34:30 -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 8146 invoked by uid 89); 22 Sep 2014 07:34:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Sep 2014 07:34:28 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Mon, 22 Sep 2014 08:34:26 +0100 Received: from localhost ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 22 Sep 2014 08:34:24 +0100 From: Richard Sandiford To: Jeff Law Mail-Followup-To: Jeff Law ,"gcc-patches\@gcc.gnu.org" , richard.sandiford@arm.com Cc: "gcc-patches\@gcc.gnu.org" Subject: Re: [PATCH 4/5] Generalise invalid_mode_change_p References: <87ppetnsxd.fsf@e105548-lin.cambridge.arm.com> <878ulhns3d.fsf@e105548-lin.cambridge.arm.com> <541C6DA0.8040405@redhat.com> Date: Mon, 22 Sep 2014 07:34:00 -0000 In-Reply-To: <541C6DA0.8040405@redhat.com> (Jeff Law's message of "Fri, 19 Sep 2014 18:53:36 +0100") Message-ID: <87lhpcm7lr.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-MC-Unique: 114092208342600801 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-09/txt/msg01765.txt.bz2 Jeff Law writes: > On 09/18/14 04:25, Richard Sandiford wrote: >> This is the main patch for the bug. We should treat a register as inval= id >> for a mode change if simplify_subreg_regno cannot provide a new register >> number for the result. We should treat a class as invalid for a mode ch= ange >> if all registers in the class are invalid. This is an extension of the = old >> CANNOT_CHANGE_MODE_CLASS-based check (simplify_subreg_regno checks C_C_C= _M). >> >> I forgot to say that the patch is a prerequisite to removing aarch64's >> C_C_C_M. There are other prerequisites too, but removing C_C_C_M without >> this patch caused regressions in the existing testsuite, which is why no >> new tests are needed. >> >> >> gcc/ >> * hard-reg-set.h: Include hash-table.h. >> (target_hard_regs): Add a finalize method and a x_simplifiable_subregs >> field. >> * target-globals.c (target_globals::~target_globals): Handle >> hard_regs->finalize. >> * rtl.h (subreg_shape): New structure. >> (shape_of_subreg): New function. >> (simplifiable_subregs): Declare. >> * reginfo.c (simplifiable_subreg): New structure. >> (simplifiable_subregs_hasher): Likewise. >> (simplifiable_subregs): New function. >> (invalid_mode_changes): Delete. >> (alid_mode_changes, valid_mode_changes_obstack): New variables. >> (record_subregs_of_mode): Remove subregs_of_mode parameter. >> Record valid mode changes in valid_mode_changes. >> (find_subregs_of_mode): Remove subregs_of_mode parameter. >> Update calls to record_subregs_of_mode. >> (init_subregs_of_mode): Remove invalid_mode_changes and bitmap >> handling. Initialize new variables. Update call to >> find_subregs_of_mode. >> (invalid_mode_change_p): Check new variables instead of >> invalid_mode_changes. >> (finish_subregs_of_mode): Finalize new variables instead of >> invalid_mode_changes. >> (target_hard_regs::finalize): New function. >> * ira-costs.c (print_allocno_costs): Call invalid_mode_change_p >> even when CLASS_CANNOT_CHANGE_MODE is undefined. >> >> Index: gcc/rtl.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- gcc/rtl.h 2014-09-15 11:55:40.459855161 +0100 >> +++ gcc/rtl.h 2014-09-15 12:26:21.249077760 +0100 >> +/* Return the shape of a SUBREG rtx. */ >> + >> +static inline subreg_shape >> +shape_of_subreg (const_rtx x) >> +{ >> + return subreg_shape (GET_MODE (SUBREG_REG (x)), >> + SUBREG_BYTE (x), GET_MODE (x)); >> +} >> + > Is there some reason you don't have a constructor that accepts a=20 > const_rtx? I was worried that by allowing implicit const_rtx->subreg_shape conversions, it would be less obvious that the rtx has to have code SUBREG. I.e. a checked conversion would be hidden in the constructor rather than being explicit. If with David's new rtx hierarchy we end up with an rtx_subreg subclass then I agree we should have a constructor that takes one of those. Thanks, Richard