SamplePGO - Do not count never-executed inlined functions when computing coverage.
authorDiego Novillo <dnovillo@google.com>
Fri, 20 Nov 2015 21:46:38 +0000 (21:46 +0000)
committerDiego Novillo <dnovillo@google.com>
Fri, 20 Nov 2015 21:46:38 +0000 (21:46 +0000)
commitddec40be2ccdba46cddd9130ae71cb6df76339ce
tree32e0d72fa07d6a405103729ac17f2986d0942f68
parentc8ef580c58935405e39f95245721f79053459b77
SamplePGO - Do not count never-executed inlined functions when computing coverage.

If a function was originally inlined but not actually hot at runtime,
its samples will not be counted inside the parent function. This throws
off the coverage calculation because it expects to find more used
records than it should.

Fixed by ignoring functions that will not be inlined into the parent.
Currently, this is inlined functions with 0 samples.  In subsequent
patches, I'll change this to mean "cold" functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253716 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/SampleProfile.cpp
test/Transforms/SampleProfile/Inputs/cov-zero-samples.prof [new file with mode: 0644]
test/Transforms/SampleProfile/cov-zero-samples.ll [new file with mode: 0644]