Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 May 2008 19:23:52 +0200
From:      Ed Schouten <ed@80386.nl>
To:        Stefan Esser <se@FreeBSD.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: FreeBSD and LLVM
Message-ID:  <20080521172352.GJ1181@hoeg.nl>
In-Reply-To: <48330CDA.2080802@FreeBSD.org>
References:  <20080520170639.GE1181@hoeg.nl> <48330CDA.2080802@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--fuRgIt480xB0EInP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello Stefan,

(CC'ing this back to the list)

* Stefan Esser <se@FreeBSD.org> wrote:
> this is great news! Can you provide your patches to upgrade the port
> to 2.3-pre?

I could, but I patched the ports rather poorly. The plists are
incorrect. I just incremented the version numbers, updated the distinfo
and made some changes to the llvm-gcc4 port to use the proper wrksrc.

> Did you, by chance, record build times with llvm-gcc compared to the
> system compiler?
>
> What about the quality of generated code (size, runtime)?
> Did you manage to get a meaning-ful program built that could be used
> as a benchmark?

I was able to compile a kernel with SMP disabled and PAE enabled. Other
combinations will not work. LLVM doesn't seem to be properly capable of
dealing with the xchg instruction in inline asm statements. A non-SMP
PAE kernel doesn't seem to use them :-)

Below are some build stats:

| llvm:
|=20
| 	114.04s user 24.86s system 176% cpu 1:18.73 total
	^ output of time(1)
|=20
| 	-rwxr-xr-x  1 ed  wheel  4456839 May 21 12:59
	^ output of ls -l kernel before stripping
| 	-rwxr-xr-x  1 ed  wheel  3596008 May 21 13:16
	^ output of ls -l kernel after stripping
|=20
| 	   text    data     bss     dec     hex
| 	3286323  229605  462280 3978208  3cb3e0
	^ output of size(1) after stripping

| gcc:
|=20
| 	119.04s user 22.64s system 178% cpu 1:19.27 total
|=20
| 	-rwxr-xr-x  1 ed  wheel  4098317 May 21 12:33
| 	-rwxr-xr-x  1 ed  wheel  3463448 May 21 12:57
|=20
| 	   text    data     bss     dec     hex
| 	3185574  220965  460216 3866755  3b0083

As you can see, compilation time is about the same, but the kernel image
is a little bigger. I don't know anything about the quality of the
generated code.

> If 2.3-pre allows the kernel to boot and run, then many user-land
> programs should work as well. Testing a make world (and preparing
> the infrastructure to support llvm in addition to gcc and icc might
> be worthwhile ...).

We should really try that. Unfortunately I'm quite busy, hacking on the
TTY layer. ;-)

> You probably know about the clang project, which tries to completely
> replace the gcc parts needed for llvm-gcc ...

Yes. I haven't looked at it yet. It doesn't seem to be in Ports yet. Any
takers? ;-)

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--fuRgIt480xB0EInP
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkg0WqgACgkQ52SDGA2eCwWTLACfSPDGFk6gBTDbOOPS7IZsf7fn
8wgAn0eIWl61Q2gs2A2c+eUhsEDIRJEp
=kXmS
-----END PGP SIGNATURE-----

--fuRgIt480xB0EInP--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080521172352.GJ1181>