From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TES1l-0000Hw-Fq for qemu-devel@nongnu.org; Wed, 19 Sep 2012 17:41:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TES1k-00037a-BO for qemu-devel@nongnu.org; Wed, 19 Sep 2012 17:41:49 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:34825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TES1k-00037K-4r for qemu-devel@nongnu.org; Wed, 19 Sep 2012 17:41:48 -0400 Received: by pbbrp12 with SMTP id rp12so3438436pbb.4 for ; Wed, 19 Sep 2012 14:41:47 -0700 (PDT) Sender: Richard Henderson Message-ID: <505A3C18.5030402@twiddle.net> Date: Wed, 19 Sep 2012 14:41:44 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1348084823-18277-1-git-send-email-aurelien@aurel32.net> <1348084823-18277-4-git-send-email-aurelien@aurel32.net> In-Reply-To: <1348084823-18277-4-git-send-email-aurelien@aurel32.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/9] tcg/optimizer: rework copy progagation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On 09/19/2012 01:00 PM, Aurelien Jarno wrote: > The copy propagation pass tries to keep track of what is a copy of what > and what has copy of what, and in addition it keep a circular list of > of all the copies. Unfortunately this doesn't fully work: a mov from > a temp which has a state "COPY" changes it into a state "HAS_COPY". > Later when this temp is used again, it is considered has not having > copy and thus no propagation is done. > > This patch fixes that by removing the hiearchy between copies, and thus > only keeping a "COPY" state both meaning "is a copy" and "has a copy". > The decision of which copy to use is deferred to the actual temp > replacement. At this stage there is not one best choice to do, but only > better choices than others. For doing the best choice the operation > would have to be parsed in reversed to know if a temp is going to be > used later or not. That what is done by the liveness analysis. At this > stage it is known that globals will always be live, that local temps > will be dead at the end of the translation block, and that the temps > will be dead at the end of the basic block. This means that this stage > should try to replace temps by local temps or globals and local temps > by globals. > > It also brings the advantage of knowing if a temp is a copy of another, > which can improve the various optimizations. > > Signed-off-by: Aurelien Jarno Reviewed-by: Richard Henderson r~