Building and Iterating
Alexander Richardson
arichardson.kde at gmail.com
Sat Jun 2 17:29:31 UTC 2018
On Fri, 1 Jun 2018 at 23:29, Brooks Davis <brooks at 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
More information about the freebsd-arch
mailing list