From owner-freebsd-toolchain@FreeBSD.ORG Tue Nov 19 07:50:11 2013 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97E29C46; Tue, 19 Nov 2013 07:50:11 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 20A732A58; Tue, 19 Nov 2013 07:50:10 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::7d33:ea42:b519:bd90] (unknown [IPv6:2001:7b8:3a7:0:7d33:ea42:b519:bd90]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 66D1B5C43; Tue, 19 Nov 2013 08:50:06 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_5F52A62D-76CD-41DA-90D7-B800976796D6"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: clang++ 3.3 issue (excessively slow compile vs. gcc 4.6 in just one file of a port) From: Dimitry Andric In-Reply-To: <528A9A88.80904@FreeBSD.org> Date: Tue, 19 Nov 2013 08:49:53 +0100 Message-Id: References: <528A8481.9010200@FreeBSD.org> <62194A12-1B41-48F6-8434-BA2181411020@FreeBSD.org> <528A93BF.3020707@FreeBSD.org> <528A9A88.80904@FreeBSD.org> To: Matthias Andree X-Mailer: Apple Mail (2.1822) Cc: freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Nov 2013 07:50:11 -0000 --Apple-Mail=_5F52A62D-76CD-41DA-90D7-B800976796D6 Content-Type: multipart/mixed; boundary="Apple-Mail=_6B0D564E-B2ED-4964-A617-C09A834DF87B" --Apple-Mail=_6B0D564E-B2ED-4964-A617-C09A834DF87B Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 On 18 Nov 2013, at 23:54, Matthias Andree wrote: ... > Uploaded. http://people.freebsd.org/~mandree/ has: > > : the xzipped .ii > file (unpacked: 6.5 MB) > > : > compiler command line (make VERBOSE=1 MAKE_JOBS_UNSAFE=yes) > and early warnings. Ok, this looks like http://llvm.org/PR16474 , which has a relatively simple fix. I have attached it, can you please try it out? You can just apply the patch to /usr/src and do: make -C /usr/src/lib/clang make -C /usr/src/usr.bin/clang/clang sudo make -C /usr/src/usr.bin/clang/clang install It should basically recompile just one file, and re-link the clang executable. I tried building ipsharpen.ii at -O3, and it uses about 20 seconds now (on my relatively slow VM). -Dimitry --Apple-Mail=_6B0D564E-B2ED-4964-A617-C09A834DF87B Content-Disposition: attachment; filename=import-llvm-r191896-1.diff Content-Type: application/octet-stream; name="import-llvm-r191896-1.diff" Content-Transfer-Encoding: 7bit Index: contrib/llvm/lib/Analysis/CaptureTracking.cpp =================================================================== --- contrib/llvm/lib/Analysis/CaptureTracking.cpp (revision 258299) +++ contrib/llvm/lib/Analysis/CaptureTracking.cpp (working copy) @@ -146,8 +146,14 @@ void llvm::PointerMayBeCaptured(const Value *V, Ca case Instruction::PHI: case Instruction::Select: // The original value is not captured via this if the new value isn't. + Count = 0; for (Instruction::use_iterator UI = I->use_begin(), UE = I->use_end(); UI != UE; ++UI) { + // If there are lots of uses, conservatively say that the value + // is captured to avoid taking too much compile time. + if (Count++ >= Threshold) + return Tracker->tooManyUses(); + Use *U = &UI.getUse(); if (Visited.insert(U)) if (Tracker->shouldExplore(U)) --Apple-Mail=_6B0D564E-B2ED-4964-A617-C09A834DF87B Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 --Apple-Mail=_6B0D564E-B2ED-4964-A617-C09A834DF87B-- --Apple-Mail=_5F52A62D-76CD-41DA-90D7-B800976796D6 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlKLGCsACgkQsF6jCi4glqOy3wCgndQTtyRI34gCaHBhgM5cSIm2 +ckAnj73b8Yd8+kJA2zJNnhlh/Eb2bHx =GjVy -----END PGP SIGNATURE----- --Apple-Mail=_5F52A62D-76CD-41DA-90D7-B800976796D6--