Date: Sat, 2 Jun 2018 18:29:18 +0100 From: Alexander Richardson <arichardson.kde@gmail.com> To: brooks@freebsd.org Cc: sbruno@freebsd.org, freebsd-arch@freebsd.org Subject: Re: Building and Iterating Message-ID: <CA%2BZ_v8prXoryfV4dKC8Rz6B8ijQgaNDtyHNJiaR1cd7VTaA5Vw@mail.gmail.com> In-Reply-To: <20180601222914.GE29648@spindle.one-eyed-alien.net> References: <cd5d5e25-34e8-5b1b-c764-affbeabf2ea8@freebsd.org> <20180601201221.GC29648@spindle.one-eyed-alien.net> <43b75e30-70af-e98d-7d9f-8fccaf3dcbba@freebsd.org> <20180601222914.GE29648@spindle.one-eyed-alien.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 1 Jun 2018 at 23:29, Brooks Davis <brooks@freebsd.org> wrote:
>
> On Fri, Jun 01, 2018 at 04:11:06PM -0600, Sean Bruno wrote:
> >
> >
> > On 06/01/18 14:12, Brooks Davis wrote:
> > > On Fri, Jun 01, 2018 at 11:20:22AM -0600, Sean Bruno wrote:
> > >> 3. If the boostrap toolchain needs to be built in the normal case, only
> > >> target the ARCH being requested. I understand that we "want" a CC
> > >> installed that targets all architectures and this is something I agree with.
> > >
> > > The LLVM backends are a tiny part of the LLVM build both in terms
> > > of number of files and compile complexity. Removing them would
> > > require quite a bit of work (and ongoing maintenance) for a negliable
> > > improvement.
> >
> > Can you educate me on why its so hard to maintain this part of our
> > tools? I'm ignorant here and haven't looked to deeply into the abyss
> > whereas you have been swimming in the darkness.
>
> Because upstream makes absolutely no provision for this. In our case we
> do maintain the build infrastructure which would help a bit (since we
> wouldn't be maintaining diffs to CMakeFiles), but it won't help at all
> with the fact that any code can assume that all backends are there and
> the constants associated with there are defined. I'm not sure how big
> that part is, but we'd certainly have some divergence to maintain. IIRC
> the backends are <5% of LLVM compile time.
>
If you build from the upstream CMakeLists you can set
-DLLVM_TARGETS_TO_BUILD=X86 (I believe =host should also work) and
then compare that to the time it takes when building with
-DLLVM_TARGETS_TO_BUILD=all. I don't think it will save very much time
compared to the total build duration since you will still need to
build quite a few files from lib/Target (especially for x86).
~/cheri/llvm(master * u=)> find lib/Target -name "*.cpp" | wc -l
723
~/cheri/llvm(master * u=)> find . -type d -name "test" -prune -o -name
"*.cpp" | wc -l
3147
Just based on this it would seem like in the best case you *might* be
able to reduce LLVM compile time by < 20%. However, depending on the
target you will have to build about 200+ files in lib/Target as well
and at least to me it seems like the .cpp in clang take a lot longer
to build than in LLVM.
My guess is that omitting the cross toolchain could give you maybe
5-10% reduction in LLVM compile time but I haven't measured it.
Alex
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BZ_v8prXoryfV4dKC8Rz6B8ijQgaNDtyHNJiaR1cd7VTaA5Vw>
