From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zen2x-0003Kp-6D for qemu-devel@nongnu.org; Wed, 23 Sep 2015 12:37:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zen2t-0000nJ-1q for qemu-devel@nongnu.org; Wed, 23 Sep 2015 12:37:31 -0400 Received: from mail-io0-x22c.google.com ([2607:f8b0:4001:c06::22c]:36320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zen2s-0000mm-JJ for qemu-devel@nongnu.org; Wed, 23 Sep 2015 12:37:26 -0400 Received: by ioii196 with SMTP id i196so49227059ioi.3 for ; Wed, 23 Sep 2015 09:37:25 -0700 (PDT) Sender: Richard Henderson References: <1442953507-4074-1-git-send-email-rth@twiddle.net> <1442953507-4074-6-git-send-email-rth@twiddle.net> <20150923145549.GA29755@morn.lan> From: Richard Henderson Message-ID: <5602D542.9070003@twiddle.net> Date: Wed, 23 Sep 2015 09:37:22 -0700 MIME-Version: 1.0 In-Reply-To: <20150923145549.GA29755@morn.lan> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 05/25] tcg: Allow extra data to be attached to insn_start List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin O'Connor Cc: peter.maydell@linaro.org, alex.bennee@linaro.org, qemu-devel@nongnu.org, aurelien@aurel32.net On 09/23/2015 07:55 AM, Kevin O'Connor wrote: > On Tue, Sep 22, 2015 at 01:24:47PM -0700, Richard Henderson wrote: >> With an eye toward having this data replace the gen_opc_* arrays >> that each target collects in order to enable restore_state_from_tb. > > Hi Richard, > > Instead of having each architecture front-end determine the constants > to be restored on an exception, have you considered having the tcg > liveness pass automatically detect them? > > What I was thinking was if: > - each front-end stored each constant on every instruction using > regular "movi" ops > - tcg_liveness_analysis() tracked which global memory "sync" writes > are purely due to an op that can raise an exception > - then tcg_liveness_analysis() could remove "movi" instructions with > outputs that are needed only during an exception and place the > constant directly in the compressed table itself. > > I'm curious if this was considered and if there is a reason it > wouldn't work well. We certainly don't have enough information to infer something like that. The moment we reach a helper that isn't marked as TCG_CALL_NO_WG, all that inference has to go out the window ans we have to assume that the "movi op" is both necessary and overwritten. The knowledge of which helpers modify a field such as cc_op is present into the translators in code form. It would require significant effort to change that. r~