Received: from eggs.gnu.org ([140.186.70.92]:35796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNZAN-0001En-Tv for qemu-devel@nongnu.org; Fri, 20 May 2011 19:31:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNZAN-00015z-4T for qemu-devel@nongnu.org; Fri, 20 May 2011 19:31:35 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:57858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNZAM-00015m-Sy for qemu-devel@nongnu.org; Fri, 20 May 2011 19:31:35 -0400 Message-Id: <009487ED-9D21-4779-A064-30044601B443@web.de> From: =?ISO-8859-1?Q?Andreas_F=E4rber?= In-Reply-To: <20110520193741.GC27170@hall.aurel32.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Sat, 21 May 2011 01:31:31 +0200 References: <4DD6A9F9.7040805@twiddle.net> <20110520193741.GC27170@hall.aurel32.net> Sender: andreas.faerber@web.de Subject: Re: [Qemu-devel] [PATCH 0/6] Implement constant folding and copy propagation in TCG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: mj.mccormack@samsung.com, Kirill Batuzov , qemu-devel@nongnu.org, zhur@ispras.ru, Richard Henderson Am 20.05.2011 um 21:37 schrieb Aurelien Jarno: > On Fri, May 20, 2011 at 10:50:49AM -0700, Richard Henderson wrote: >> On 05/20/2011 05:39 AM, Kirill Batuzov wrote: >>> This series implements some basic machine-independent >>> optimizations. They >>> simplify code and allow liveness analysis do it's work better. >>> >>> Suppose we have following ARM code: >>> >>> movw r12, #0xb6db >>> movt r12, #0xdb6d >>> >>> In TCG before optimizations we'll have: >>> >>> movi_i32 tmp8,$0xb6db >>> mov_i32 r12,tmp8 >>> mov_i32 tmp8,r12 >>> ext16u_i32 tmp8,tmp8 >>> movi_i32 tmp9,$0xdb6d0000 >>> or_i32 tmp8,tmp8,tmp9 >>> mov_i32 r12,tmp8 >>> >>> And after optimizations we'll have this: >>> >>> movi_i32 r12,$0xdb6db6db >>> >>> Here are performance evaluation results on SPEC CPU2000 integer >>> tests in >>> user-mode emulation on x86_64 host. There were 5 runs of each >>> test on >>> reference data set. The tables below show runtime in seconds for >>> all these >>> runs. >> >> I totally agree that this sort of optimization is needed in TCG. > > I basically stopped working on constant propagation, as while the TCG > code looked nicer, the resulting code was always slower. Has anyone evaluated reusing LLVM optimization passes for TCG? Or maybe GIMPL if there's an equivalent? Andreas