[legacyPM] Do not compute preserved analysis if there's no local change
authorserge-sans-paille <sguelton@redhat.com>
Tue, 28 Jul 2020 08:55:09 +0000 (10:55 +0200)
committerserge-sans-paille <sguelton@redhat.com>
Tue, 28 Jul 2020 09:01:04 +0000 (11:01 +0200)
commit3218c064d6d8c2cc910570c9a13cb859a2e91d08
tree71280a60d93b54970b6f7384ce9fca3d700b9511
parentee068aafbc5c6722158d5113290a211503e1cfe4
[legacyPM] Do not compute preserved analysis if there's no local change

All analysis are preserved if there's no local change, and thanks to
3667d87a33d3c8d4072a41fd84bb880c59347dc0 this property is enforced for all
passes.

Skipping the dependency computation improves the performance when there's a lot
of small functions, where only a few change happen.

Thanks to Nikita Popov who provided this numbers (extract below)

https://llvm-compile-time-tracker.com/compare.php?from=183342c0a9850e60dd7a004b651c83dfb3a7d25e&to=f2f91e6a2743070471cc9471e4e8c646e50c653c&stat=instructions

O3: (number of instructions)
Benchmark               Old             New
kimwitu++               60783M          59968M          (-1.34%)
sqlite3                 73200M          73083M          (-0.16%)
consumer-typeset        52776M          52712M          (-0.12%)
Bullet                  133709M         132940M         (-0.58%)
tramp3d-v4              123864M         123186M         (-0.55%)
mafft                   55534M          55477M          (-0.10%)
ClamAV                  76292M          76164M          (-0.17%)
lencod                  103190M         103061M         (-0.13%)
SPASS                   64068M          63713M          (-0.55%)
7zip                    197332M         196308M         (-0.52%)
geomean                 85750M          85389M          (-0.42%)

Differential Revision: https://reviews.llvm.org/D80707
llvm/lib/IR/LegacyPassManager.cpp