[SampleFDO] Skip profile reading when flattened profile used in ThinLTO postlink
authorWei Mi <wmi@google.com>
Thu, 17 Jan 2019 20:48:34 +0000 (20:48 +0000)
committerWei Mi <wmi@google.com>
Thu, 17 Jan 2019 20:48:34 +0000 (20:48 +0000)
commit3bcccdfe38f28f8d19faa957cd56ed4d03cd40fb
tree21a5f3a7d03365f95cbdf1ead65d549c1f7bf85f
parentedd653bc072dcafa5e54c2c91b7cf20343b2664c
[SampleFDO] Skip profile reading when flattened profile used in ThinLTO postlink

If the sample profile has no inlining hierachy information included, we call
the sample profile is flattened. For flattened profile, in ThinLTO postlink
phase, SampleProfileLoader's hot function inlining and profile annotation will
do nothing, so it is better to save the effort to read in the profile and run
the sample profile loader pass. It is helpful for reducing compile time when
the flattened profile is huge.

Differential Revision: https://reviews.llvm.org/D54819

llvm-svn: 351476
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
llvm/test/Transforms/SampleProfile/Inputs/flattened.prof [new file with mode: 0644]
llvm/test/Transforms/SampleProfile/flattened.ll [new file with mode: 0644]