On Fri, Aug 04, 2017 at 08:45:14AM +0300, Henri Sivonen wrote:
> I guess I buried my questions in too long a post, so extracting them:
> 
> On Mon, Jul 31, 2017 at 1:02 PM, Henri Sivonen <hsivo...@hsivonen.fi> wrote:
> > Naïvely, one would think that it should be possible to do that with
> > clang producing "object files" holding LLVM IR and rustc producing
> > "object files" holding LLVM IR and the "link" step involving mashing
> > those together, running LLVM optimizations again and then producing
> > machine code from a massive collection of mashed-together LLVM IR.
> ...
> > If we were compiling C++ using clang on all platforms, how far off
> > would such cross-language inlining be?
> >
> > If we could have the cross-language inlining benefit from compiling
> > C++ using clang on all platforms, how far off would we be from being
> > able to switch to clang on all platforms?

Here's a bunch of data why "let's switch compilers" is not necessarily
easy (I happen to have gathered that recently):

Windows MSVC (PGO) vs. clang-cl:
https://treeherder.mozilla.org/perf.html#/compare?originalProject=try&originalRevision=581eab2aa162&newProject=try&newRevision=c963d0cd6565&framework=1&showOnlyImportant=0

Windows MSVC (PGO) vs. clang-cl -O2 (the build system currently uses -O1 for
msvc builds, which flags we use for clang-cl builds):
https://treeherder.mozilla.org/perf.html#/compare?originalProject=try&originalRevision=581eab2aa162&newProject=try&newRevision=c963d0cd6565&framework=1&showOnlyImportant=0

Newer versions of clang-cl might generate faster code, but they crash
during the build: https://bugs.llvm.org/show_bug.cgi?id=33997

  Note that the tp5n main_startup_fileio reflects the resulting size of
  xul.dll, which also impacts the installer size:
                 32-bits   64-bits
  MSVC (PGO):   37904383  40803170
  clang-cl:     39537860  40561849
  clang-cl -O2: 41976097  43338891

  64-bits clang-cl is miraculously smaller, but the zip is larger, and so
  is the on-disk xul.dll.


Linux gcc 4.9 PGO vs clang trunk (r309511):
https://treeherder.mozilla.org/perf.html#/compare?originalProject=try&originalRevision=3c83f65009d6&newProject=try&newRevision=5d22234f2596&framework=1&showOnlyImportant=0

This might look unfair (PGO vs. not-PGO), but for some reason, trying
PGO with clang breaks the build... while invoking cargo...
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8aeb26f7b22b7c8a03602229caa79d20bdadc94d
if anyone wants to take a look.

Mike
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to