[FuncSpec] Enable it only with -O3
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Thu, 4 Nov 2021 10:36:19 +0000 (10:36 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Thu, 4 Nov 2021 13:59:00 +0000 (13:59 +0000)
commit3fd1902ad8ebfaecc57e68aaa6620332dda8d5f9
tree934e7ac88f57d11f3f3502fd52f8872965264128
parentb738a69ab8e3da2d48fdf41aa1fa5a5673a7d3a1
[FuncSpec] Enable it only with -O3

Function specialisation was running at all optimisation levels (if enabled on
the command line, it is not on by default). That was an oversight and not
something we want to do. Function specialisation duplicates functions when it
triggers, so the backend is processing more functions/instructions resulting in
compile-time increases, which seems more appropriate with -O3 and inline with
GCC. Please note that since function specialisation is not enabled by default,
this didn't require updating any pass manager tests.

Differential Revision: https://reviews.llvm.org/D112129
llvm/lib/Passes/PassBuilderPipelines.cpp
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp