From owner-freebsd-arch@FreeBSD.ORG Mon Jan 7 16:31:52 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B34FB809; Mon, 7 Jan 2013 16:31:52 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by mx1.freebsd.org (Postfix) with ESMTP id F0308633; Mon, 7 Jan 2013 16:31:51 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id dq12so10159175wgb.24 for ; Mon, 07 Jan 2013 08:31:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=kUMribF3yu7gycPE1tU3/fD0BBWKU6s4mjyhSWIzMrU=; b=ez2P/4Hw8zHwTfArti+Q2QgWVrL6c0JajtEm9qKmiatKFyk9/XOyJf35hWRgv63H9v lXC1dKyGG7jh0h0myLoCEgEagJDfZNHXSSdkTcY6RufqdFhoi2MGhqe8dhcyZzglP5v3 khakCD170AcBrTVUAnQ7u4i15hfntSlKMwe4mgyKFZc0c2Z6U7spW2h1LR8jBOOFqwb3 EO3D7rjb3YsGwTuLuldc4owkOgGnh0x2lWDlBQ2l6Fiz+iDZ01IZ7KVK+zKc6SoUFst8 JujnICAlD4pYhVzfFi0d85gRAAnqLT22z9AVez9cWoBzFDy3mYXKx3D4tzANB5tEUob6 YWtA== X-Received: by 10.180.78.137 with SMTP id b9mr10112881wix.30.1357575912696; Mon, 07 Jan 2013 08:25:12 -0800 (PST) Received: from dragon.dg (41-135-148-131.dsl.mweb.co.za. [41.135.148.131]) by mx.google.com with ESMTPS id h19sm12811757wiv.7.2013.01.07.08.25.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 07 Jan 2013 08:25:11 -0800 (PST) From: David Naylor To: freebsd-toolchain@freebsd.org Subject: Re: LLVM Image Activator Date: Mon, 7 Jan 2013 18:25:03 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.9.1; amd64; ; ) References: <50E9BC2D.7000302@freebsd.org> In-Reply-To: <50E9BC2D.7000302@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1362420.XBIvH0nEZn"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201301071825.06439.naylor.b.david@gmail.com> Cc: Nathan Whitehorn , freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 16:31:52 -0000 --nextPart1362420.XBIvH0nEZn Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Just my 2c On Sunday, 6 January 2013 20:02:21 Nathan Whitehorn wrote: > Having LLVM/clang in the base system lets us do some interesting things > that we couldn't do with GCC. One is that LLVM ships with a JIT for LLVM > IR as well as components of a toolchain for it (this is what Google's > pNACL uses) and that you can end up producing binary files that are in > IR instead of native code. The IR isn't really cross-platform, but does > let you do CPU-specific optimizations when executed by the JIT, etc. >=20 > The attached patch causes the LLVM JIT (lli) to be built by default > (adding ~20 seconds to buildworld on my five-year-old laptop) and adds a > kernel image activator that invokes it when passed LLVM bitcode files. > It's not completely finished (see the XXX comment in the middle), but it > does work, as follows: >=20 > $ clang -emit-llvm -c -o hw.ll hw.c > $ file hw.ll > hw.ll: LLVM bitcode > $ lli hw.ll > Hello world! > $ chmod a+x hw.ll > $ ./hw.ll > Hello world! > $ >=20 > Is there any interest in having features like this? It seems like this > could provides some interesting possibilities for us and nice > integration from having imported clang into base. Would it be possible to have this as a module (and thus in ports)? Or,=20 perhaps, change the sources such these things could be loaded as a module... Also, with modification to LLVM, wouldn't the existing '#!' mechanism work= =20 (aka '#!/usr/bin/lli') at the beginning of the file? =20 On an aside. Could you imagine shipping a 'x86' llvm-byte code and get the= =20 jit (with caching), thus your computer will get full support (speed) from t= he=20 binaries and the binaries will work on all 'x86' related architectures. (M= y=20 thinking is for things like i386 vs pentium4). =20 Regards --nextPart1362420.XBIvH0nEZn Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEABECAAYFAlDq9uIACgkQUaaFgP9pFrKo3ACeNX5ZhxuslKEem1bHkRpR8YQd HDoAn1Ukz4GTpxieoB7u1C7UFCSJsV90 =r9wK -----END PGP SIGNATURE----- --nextPart1362420.XBIvH0nEZn--