[llvm-dev] RFC: Switching to the new pass manager by default

Davide Italiano via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 19 08:48:50 PDT 2017


On Thu, Oct 19, 2017 at 4:50 AM, Greg Bedwell via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I just tried putting a relatively recent version of our merge branch
> (r316139 + our local changes) through a small subset of the PS4 testing with
> -fexperimental-new-pass-manager enabled.  In general, most tests passed :).
> There are a few failures I'd need to look at in more detail though.  The
> most glaring are all our tests related to generating coverage info:
>
> $ cat 1.cpp
> void foo(){}
> $ ./build/bin/clang -c -fprofile-instr-generate -fcoverage-mapping 1.cpp
> $ ./build/bin/clang -c -fprofile-instr-generate -fcoverage-mapping 1.cpp
> -fexperimental-new-pass-manager
> instrprof failed to lower an increment
> UNREACHABLE executed at
> /home/greg/public_git/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:5893!
>
> which I'm assuming is the same thing as was reported in
> https://bugs.llvm.org/show_bug.cgi?id=33773 .  This would definitely be a
> prerequisite for us to consider flipping the default.
>
> There are a few tests looking for specific codegen that are seeing something
> different.  At a glance, it looks like the output from clang's -O2 looks
> roughly similar in some small examples with and without the new PM, but
> clang's -O1 is producing very different output.  Whether this is an issue, I
> can't say for sure (I've not tried benchmarking the -O1s against each other
> yet).  Is this expected?
>
> I've also got an example of a specific file that shows quite a large compile
> time increase with the new PM:
>
> Old PM:
>    ---User Time---   --System Time--   --User+System--   ---Wall Time---
> --- Name ---
>   15.8125 ( 96.0%)   0.2969 ( 95.0%)  16.1094 ( 96.0%)  16.1059 ( 96.1%)
> Code Generation Time
>    0.6563 (  4.0%)   0.0156 (  5.0%)   0.6719 (  4.0%)   0.6609 (  3.9%)
> LLVM IR Generation Time
>   16.4688 (100.0%)   0.3125 (100.0%)  16.7813 (100.0%)  16.7668 (100.0%)
> Total
>
> New PM:
>    ---User Time---   --System Time--   --User+System--   ---Wall Time---
> --- Name ---
>   67.0781 ( 99.1%)   0.3438 ( 95.7%)  67.4219 ( 99.0%)  67.4543 ( 99.0%)
> Code Generation Time
>    0.6406 (  0.9%)   0.0156 (  4.3%)   0.6563 (  1.0%)   0.6644 (  1.0%)
> LLVM IR Generation Time
>   67.7188 (100.0%)   0.3594 (100.0%)  68.0781 (100.0%)  68.1187 (100.0%)
> Total
>
> It's not an example I can easily share (and also not one I'm easily able to
> verify in its present state on a branch without our local changes to make
> sure they're not responsible somehow), but if it's of interest I can see
> whether I can reduce it to something shareable and raise a bug.
>
> If I get a chance, I'll try putting this through some PS4 game codebases to
> see how build time and run time performance compare there, but I'm one of
> the few manning the fort while most of the rest of the team is out having a
> nice time at the Developers' Meeting this week, so I may not get that chance
> for a bit.
>

FWIW, I've been running with the new PM on on several PS4 codebases
(the one I have available) for the last year or such, and I didn't see
any major compile time/runtime performance increase (or decrease,
FWIW). The set of games I have access to may be slightly different
than yours, so I suppose it's still a good thing to give it a shot,
but I wanted to throw yet another datapoint on the table.


More information about the llvm-dev mailing list