From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29815 invoked by alias); 22 Aug 2005 14:12:52 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 29799 invoked by uid 22791); 22 Aug 2005 14:12:46 -0000 Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 22 Aug 2005 14:12:46 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.12.10/8.12.10) with ESMTP id j7MECiTZ142730 for ; Mon, 22 Aug 2005 14:12:44 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j7MEChYC185072 for ; Mon, 22 Aug 2005 16:12:44 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11/8.13.3) with ESMTP id j7MEChFd024282 for ; Mon, 22 Aug 2005 16:12:43 +0200 Received: from d12ml102.megacenter.de.ibm.com (d12ml102.megacenter.de.ibm.com [9.149.166.138]) by d12av02.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j7MEChGG024279 for ; Mon, 22 Aug 2005 16:12:43 +0200 In-Reply-To: <43097A70.70108@lu.unisi.ch> To: Paolo Bonzini Cc: GCC Development MIME-Version: 1.0 Subject: Re: Question about merging two instructions. From: Leehod Baruch Message-ID: Date: Mon, 22 Aug 2005 14:12:00 -0000 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2005-08/txt/msg00590.txt.bz2 Paolo Bonzini wrote on 22/08/2005 10:10:40: > > > I tried to use simplify_replace_rtx to replace any use of (reg r) with[in] > > > the right-hand-side of the extension and simplify the result. > > If he want to replace uses within the RHS of the extension, he should > pass SET_SRC (pat). He may as well want to handle parallels, in which > case he should write a new function similar to this: I think you misunderstood my original purpose. I did mean [with] and not [in]. Let me explain again. I have these two instructions: (insn 1 0 2 0 (set (reg/v:Xmode r) (sign_extend:Xmode (op:Ymode (...)))) (insn 2 1 3 0 (set (LHS) (RHS))) where: 1. Xmode > Ymode 2. RHS and/or LHS may contain: (subreg:Ymode (reg/v:Xmode r) lowpart) and/or (reg/v:Xmode r). Now I want to replace every *use* of (reg r) in insn 2 with the rhs of insn 1 and simplify the result. This is way the replacement may happen in the LHS of insn 2. Note that I don't want to replace any *def* and uses may appear in the LHS. My plan was to use: replace_regs () to replace every use of (reg r) with the a new pseudo register (because this is the only function that I found that separates the uses from the defs) and then use simplifiy_replace_rtx () to replace that new pseudo register with the rhs of insn 1 and simplify. To make things even more complicated - insn 2 may be PARALLEL. Maybe I should use simplify_rtx (replace_rtx (..))? But it seem to me that simplify_rtx () doesn't deal with SET either. Do you see a better way? Thanks, Leehod.