Closed Bug 1619461 Opened 7 months ago Closed 6 months ago

Investigate using LLVM's new pass manager

Categories

(Firefox Build System :: Toolchains, task, P3)

task

Tracking

(firefox76 fixed)

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: dmajor, Assigned: dmajor)

References

(Regressed 1 open bug)

Details

Attachments

(1 file)

LLVM has a component called the pass manager that handles the registration and ordering of optimization passes. This component has been under a rewrite for several years, with the new version selectable under the flag -fexperimental-new-pass-manager.

The new pass manager has much better optimization, with preliminary try pushes showing 3-5% improvement on Speedometer and 7-8% on reftest singletons, including improvements in the 18% range on multiple subtests. And the code is smaller too.

I think at this point the code has been in development long enough that it's worth trying out. We should put it through as thorough testing as possible, of course.

I'm not sure what would be the best scope for this flag. Should we turn it on everywhere? Only on PGO or CI builds? To avoid chasing unnecessary bugs, I'd say we shouldn't use the new flag in clang versions older than Mozilla's (currently 9). Aside from that, I think I lean towards enabling it in as many build configs as possible, as a bigger net for catching issues, but I'm open to other opinions about this.

Priority: -- → P3
Depends on: 1620694

LLVM's new pass manager has been in the works for several years and has better optimization (sometimes much better) than the legacy pass manager. I think it's in good enough shape for us to try at this point.

While we only really need the new pass manager for shippable builds, as a general principle I'd like to use it as much as possible, to help catch bugs for upstream. Therefore this patch enables the new pass manager by default for all clang builds, with the single exception being compilers older than version 9. There isn't a specific problem with older versions; I just don't want to sign up for the support cost of debugging people's local builds that may be fixed already.

I don't expect it to be necessary, but just in case, an opt-out is available via ac_add_options --disable-new-pass-manager.

Assignee: nobody → dmajor
Status: NEW → ASSIGNED
Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2f5aba2e2c09
Enable the new pass manager in clang builds. r=rstewart,glandium
Pushed by apavel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/96be905c6a7d
Enable the new pass manager in clang builds. r=rstewart,glandium
Flags: needinfo?(dmajor)
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
No longer depends on: 1621917
Regressions: 1621917

== Change summary for alert #25339 (as of Thu, 12 Mar 2020 09:21:18 GMT) ==

Improvements:

15% perf_reftest_singletons bidi-resolution-1.html macosx1014-64-shippable opt e10s stylo 165.06 -> 140.29
13% perf_reftest_singletons id-getter-3.html macosx1014-64-shippable opt e10s stylo 498.22 -> 434.28
13% perf_reftest_singletons id-getter-4.html macosx1014-64-shippable opt e10s stylo 497.20 -> 433.97
12% perf_reftest_singletons id-getter-5.html macosx1014-64-shippable opt e10s stylo 498.05 -> 435.90
12% perf_reftest_singletons id-getter-6.html macosx1014-64-shippable opt e10s stylo 497.76 -> 436.10
12% perf_reftest_singletons id-getter-7.html macosx1014-64-shippable opt e10s stylo 494.66 -> 434.03
12% perf_reftest_singletons external-string-pass.html macosx1014-64-shippable opt e10s stylo 806.09 -> 711.78
10% perf_reftest_singletons id-getter-2.html macosx1014-64-shippable opt e10s stylo 884.47 -> 793.97
10% perf_reftest_singletons id-getter-1.html macosx1014-64-shippable opt e10s stylo 505.73 -> 454.59
10% perf_reftest_singletons abspos-reflow-1.html macosx1014-64-shippable opt e10s stylo 65.58 -> 58.98
8% perf_reftest_singletons tiny-traversal-singleton.html macosx1014-64-shippable opt e10s stylo 801.46 -> 734.30
8% perf_reftest_singletons getElementById-1.html macosx1014-64-shippable opt e10s stylo 53.88 -> 49.55
7% perf_reftest_singletons style-sharing-style-attr.html macosx1014-64-shippable opt e10s stylo 5.95 -> 5.52
6% perf_reftest_singletons style-sharing.html macosx1014-64-shippable opt e10s stylo 5.75 -> 5.38
6% perf_reftest_singletons window-named-property-get.html macosx1014-64-shippable opt e10s stylo 672.15 -> 635.05
5% perf_reftest_singletons window-named-property-get.html macosx1014-64-shippable opt e10s stylo 677.14 -> 640.29

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=25339

As it can take some time for other platforms and test suites to come in, I went through the pushlogs on later perf alerts and additionally found:

4% Stylo Servo_StyleSheet_FromUTF8Bytes_Bench macosx1014-64-shippable opt 40,992.92 -> 39,374.17
4% Stylo Servo_StyleSheet_FromUTF8Bytes_Bench_UseCounters macosx1014-64-shippable opt 40,835.08 -> 39,298.92
7% displaylist_mutate linux64-shippable opt e10s stylo 1,514.58 -> 1,403.84
8% displaylist_mutate windows10-64-shippable opt e10s stylo 1,454.17 -> 1,331.14
12% displaylist_mutate windows7-32-shippable opt e10s stylo 1,577.85 -> 1,385.65
6% perf_reftest_singletons abspos-reflow-1.html linux64-shippable opt e10s stylo 49.49 -> 46.73
5% perf_reftest_singletons abspos-reflow-1.html linux64-shippable-qr opt e10s stylo 51.90 -> 49.17
8% perf_reftest_singletons abspos-reflow-1.html windows10-64-shippable opt e10s stylo 55.90 -> 51.34
8% perf_reftest_singletons abspos-reflow-1.html windows10-64-shippable-qr opt e10s stylo 56.21 -> 51.82
7% perf_reftest_singletons abspos-reflow-1.html windows7-32-shippable opt e10s stylo 55.28 -> 51.45
11% perf_reftest_singletons bidi-resolution-1.html windows10-64-shippable opt e10s stylo 146.51 -> 130.15
12% perf_reftest_singletons bidi-resolution-1.html windows10-64-shippable-qr opt e10s stylo 146.39 -> 129.44
9% perf_reftest_singletons bidi-resolution-1.html windows7-32-shippable opt e10s stylo 144.58 -> 130.92
13% perf_reftest_singletons external-string-pass.html linux64-shippable opt e10s stylo 726.16 -> 633.31
13% perf_reftest_singletons external-string-pass.html linux64-shippable-qr opt e10s stylo 754.77 -> 657.86
15% perf_reftest_singletons external-string-pass.html windows10-64-shippable opt e10s stylo 834.00 -> 708.87
15% perf_reftest_singletons external-string-pass.html windows10-64-shippable-qr opt e10s stylo 841.93 -> 712.87
12% perf_reftest_singletons external-string-pass.html windows7-32-shippable opt e10s stylo 904.08 -> 794.65
8% perf_reftest_singletons getElementById-1.html linux64-shippable opt e10s stylo 53.79 -> 49.65
8% perf_reftest_singletons getElementById-1.html linux64-shippable-qr opt e10s stylo 56.13 -> 51.78
8% perf_reftest_singletons getElementById-1.html windows10-64-shippable opt e10s stylo 52.25 -> 47.87
10% perf_reftest_singletons getElementById-1.html windows10-64-shippable-qr opt e10s stylo 53.10 -> 47.62
9% perf_reftest_singletons getElementById-1.html windows7-32-shippable opt e10s stylo 56.58 -> 51.53
11% perf_reftest_singletons id-getter-1.html linux64-shippable opt e10s stylo 417.98 -> 373.18
11% perf_reftest_singletons id-getter-1.html linux64-shippable-qr opt e10s stylo 441.55 -> 391.28
16% perf_reftest_singletons id-getter-1.html windows10-64-shippable opt e10s stylo 533.63 -> 449.80
17% perf_reftest_singletons id-getter-1.html windows10-64-shippable-qr opt e10s stylo 533.44 -> 440.56
23% perf_reftest_singletons id-getter-1.html windows7-32-shippable opt e10s stylo 608.69 -> 465.76
8% perf_reftest_singletons id-getter-2.html linux64-shippable opt e10s stylo 739.88 -> 681.47
9% perf_reftest_singletons id-getter-2.html linux64-shippable-qr opt e10s stylo 773.17 -> 707.44
14% perf_reftest_singletons id-getter-2.html windows10-64-shippable-qr opt e10s stylo 890.27 -> 766.37
22% perf_reftest_singletons id-getter-2.html windows7-32-shippable opt e10s stylo 601.78 -> 467.21
12% perf_reftest_singletons id-getter-3.html linux64-shippable opt e10s stylo 421.02 -> 372.19
12% perf_reftest_singletons id-getter-3.html linux64-shippable-qr opt e10s stylo 444.60 -> 391.60
14% perf_reftest_singletons id-getter-3.html windows10-64-shippable opt e10s stylo 524.23 -> 448.91
17% perf_reftest_singletons id-getter-3.html windows10-64-shippable-qr opt e10s stylo 529.40 -> 439.19
22% perf_reftest_singletons id-getter-3.html windows7-32-shippable opt e10s stylo 601.08 -> 467.49
12% perf_reftest_singletons id-getter-4.html linux64-shippable opt e10s stylo 420.61 -> 372.08
12% perf_reftest_singletons id-getter-4.html linux64-shippable-qr opt e10s stylo 444.52 -> 391.95
15% perf_reftest_singletons id-getter-4.html windows10-64-shippable opt e10s stylo 525.14 -> 446.78
17% perf_reftest_singletons id-getter-4.html windows10-64-shippable-qr opt e10s stylo 528.59 -> 438.53
23% perf_reftest_singletons id-getter-4.html windows7-32-shippable opt e10s stylo 607.14 -> 468.12
12% perf_reftest_singletons id-getter-5.html linux64-shippable opt e10s stylo 420.24 -> 371.14
12% perf_reftest_singletons id-getter-5.html linux64-shippable-qr opt e10s stylo 444.16 -> 391.82
15% perf_reftest_singletons id-getter-5.html windows10-64-shippable opt e10s stylo 523.95 -> 446.10
17% perf_reftest_singletons id-getter-5.html windows10-64-shippable-qr opt e10s stylo 528.34 -> 438.98
22% perf_reftest_singletons id-getter-5.html windows7-32-shippable opt e10s stylo 601.86 -> 467.27
12% perf_reftest_singletons id-getter-6.html linux64-shippable opt e10s stylo 420.42 -> 371.73
12% perf_reftest_singletons id-getter-6.html linux64-shippable-qr opt e10s stylo 446.54 -> 391.33
15% perf_reftest_singletons id-getter-6.html windows10-64-shippable opt e10s stylo 524.36 -> 446.68
17% perf_reftest_singletons id-getter-6.html windows10-64-shippable-qr opt e10s stylo 530.26 -> 439.37
22% perf_reftest_singletons id-getter-6.html windows7-32-shippable opt e10s stylo 600.61 -> 466.81
12% perf_reftest_singletons id-getter-7.html linux64-shippable opt e10s stylo 422.09 -> 371.28
12% perf_reftest_singletons id-getter-7.html linux64-shippable-qr opt e10s stylo 446.12 -> 391.39
15% perf_reftest_singletons id-getter-7.html windows10-64-shippable opt e10s stylo 524.97 -> 447.58
17% perf_reftest_singletons id-getter-7.html windows10-64-shippable-qr opt e10s stylo 527.94 -> 438.77
22% perf_reftest_singletons id-getter-7.html windows7-32-shippable opt e10s stylo 601.96 -> 466.76
8% perf_reftest_singletons scrollbar-styles-1.html windows10-64-shippable-qr opt e10s stylo 584.39 -> 539.04
7% perf_reftest_singletons scrollbar-styles-1.html windows7-32-shippable opt e10s stylo 558.46 -> 517.20
10% perf_reftest_singletons style-sharing-style-attr.html windows10-64-shippable opt e10s stylo 5.20 -> 4.69
9% perf_reftest_singletons style-sharing-style-attr.html windows10-64-shippable-qr opt e10s stylo 5.21 -> 4.74
10% perf_reftest_singletons style-sharing.html windows10-64-shippable opt e10s stylo 5.06 -> 4.56
11% perf_reftest_singletons style-sharing.html windows10-64-shippable-qr opt e10s stylo 5.15 -> 4.60
6% perf_reftest_singletons tiny-traversal-singleton.html linux64-shippable opt e10s stylo 680.87 -> 640.88
7% perf_reftest_singletons tiny-traversal-singleton.html linux64-shippable-qr opt e10s stylo 726.80 -> 673.43
8% perf_reftest_singletons tiny-traversal-singleton.html windows10-64-shippable opt e10s stylo 752.47 -> 694.57
9% perf_reftest_singletons tiny-traversal-singleton.html windows10-64-shippable-qr opt e10s stylo 773.85 -> 708.10
7% perf_reftest_singletons window-named-property-get.html windows10-64-shippable opt e10s stylo 649.04 -> 602.31
7% perf_reftest_singletons window-named-property-get.html windows7-32-shippable opt e10s stylo 625.00 -> 579.90
4% raptor-ares6-firefox linux64-shippable opt 48.64 -> 46.70
3% raptor-ares6-firefox linux64-shippable-qr opt 48.56 -> 46.89
5% raptor-ares6-firefox windows10-64-shippable-qr opt 50.81 -> 48.38
4% raptor-ares6-firefox windows7-32-shippable opt 51.04 -> 48.88
3% raptor-speedometer-firefox linux64-shippable opt 91.81 -> 94.21
2% raptor-speedometer-firefox linux64-shippable-qr opt 90.99 -> 93.17
2% raptor-stylebench-firefox linux64-shippable opt 42.34 -> 43.28
4% raptor-stylebench-firefox windows10-64-shippable opt 44.64 -> 46.55
4% raptor-stylebench-firefox windows7-32-shippable opt 46.70 -> 48.38
2% raptor-tp6-google-mail-firefox-cold loadtime linux64-shippable-qr opt 624.67 -> 612.17
2% raptor-tp6-twitch-firefox-cold loadtime linux64-shippable opt 1,202.35 -> 1,175.08
4% raptor-tp6m-google-maps-geckoview-cold android-hw-g5-7-0-arm7-api-16 pgo 1,186.10 -> 1,140.89
4% raptor-tp6m-google-maps-geckoview-cold fcp android-hw-g5-7-0-arm7-api-16 pgo 1,135.17 -> 1,093.67
4% raptor-webaudio-firefox linux64-shippable opt 118.33 -> 113.25
4% raptor-webaudio-firefox linux64-shippable-qr opt 122.92 -> 118.00
8% raptor-webaudio-firefox macosx1014-64-shippable opt 146.92 -> 135.33
8% raptor-webaudio-firefox windows10-64-shippable opt 141.67 -> 130.33
8% raptor-webaudio-firefox windows10-64-shippable-qr opt 141.08 -> 129.17
8% raptor-webaudio-firefox windows7-32-shippable opt 180.12 -> 165.00
4% tabswitch windows7-32-shippable opt e10s stylo 11.77 -> 11.34
2% tp5o linux64-shippable-qr opt e10s stylo 198.82 -> 193.89
2% tp5o_scroll linux64-shippable opt e10s stylo 1.27 -> 1.24
3% tp5o_scroll windows7-32-shippable opt e10s stylo 1.39 -> 1.35
6% tp5o_webext responsiveness linux64-shippable opt e10s stylo 2.71 -> 2.54

Also the Strings microbenchmarks are looking very good but I think the gains are exaggerated by some noisy landings before this bug, these are probably two-thirds real:

18% Strings PerfLatin1toUTF16AsciiFifteen macosx1014-64-shippable opt 997.83 -> 816.92
16% Strings PerfLatin1toUTF16AsciiHundred macosx1014-64-shippable opt 4,368.54 -> 3,656.92
27% Strings PerfLatin1toUTF16AsciiOne macosx1014-64-shippable opt 758.62 -> 552.83
9% Strings PerfLatin1toUTF16AsciiThousand macosx1014-64-shippable opt 7,267.21 -> 6,607.17

See Also: → 1622668

== Change summary for alert #25342 (as of Thu, 12 Mar 2020 11:43:54 GMT) ==

Improvements:

5% raptor-ares6-firefox windows10-64-shippable-qr opt 50.81 -> 48.38
4% raptor-ares6-firefox linux64-shippable-qr opt 48.89 -> 47.06

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=25342

Regressions: 1622856

== Change summary for alert #25417 (as of Tue, 17 Mar 2020 06:18:37 GMT) ==

Improvements:

4% raptor-speedometer-firefox windows10-64-shippable-qr opt 87.25 -> 90.98
4% raptor-ares6-firefox windows7-32-shippable opt 51.04 -> 48.88
4% raptor-ares6-firefox linux64-shippable opt 48.64 -> 46.70
3% raptor-ares6-firefox linux64-shippable-qr opt 48.56 -> 46.89
3% raptor-ares6-firefox linux64-shippable opt 48.68 -> 47.08
2% raptor-speedometer-firefox linux64-shippable-qr opt 91.90 -> 93.95
2% raptor-speedometer-firefox linux64-shippable opt 91.83 -> 93.84

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=25417

== Change summary for alert #25631 (as of Wed, 15 Apr 2020 16:53:08 GMT) ==

Improvements:

3% raptor-speedometer-firefox windows10-64-shippable opt 87.91 -> 90.40

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=25631

Depends on: 1631929
You need to log in before you can comment on or make changes to this bug.