Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Nov 2013 08:49:53 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Matthias Andree <mandree@FreeBSD.org>
Cc:        freebsd-toolchain@freebsd.org
Subject:   Re: clang++ 3.3 issue (excessively slow compile vs. gcc 4.6 in just one file of a port)
Message-ID:  <EF23C57E-DA99-4655-A260-FE0732476304@FreeBSD.org>
In-Reply-To: <528A9A88.80904@FreeBSD.org>
References:  <528A8481.9010200@FreeBSD.org> <62194A12-1B41-48F6-8434-BA2181411020@FreeBSD.org> <528A93BF.3020707@FreeBSD.org> <C350407E-E262-4E47-B1A5-09F5374C1AED@FreeBSD.org> <528A9A88.80904@FreeBSD.org>

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

--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 <mandree@FreeBSD.org> wrote:
...
> Uploaded. http://people.freebsd.org/~mandree/ has:
> 
> <http://people.freebsd.org/~mandree/ipsharpen.ii.xz>: the xzipped .ii
> file (unpacked: 6.5 MB)
> 
> <http://people.freebsd.org/~mandree/ipsharpen-compile%2bwarnings.txt>:
> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EF23C57E-DA99-4655-A260-FE0732476304>