summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2018-09-14 20:52:59 +0000
committerWei Mi <wmi@google.com>2018-09-14 20:52:59 +0000
commit6a14325dffb7a0607e5b3c75d93a837cadad54b4 (patch)
treeb66e8dff99504155918123b84a96f9577a905c10 /llvm/lib/Transforms
parent11511ab5cf306c7c688917bdd69e47dac7292756 (diff)
downloadbcm5719-llvm-6a14325dffb7a0607e5b3c75d93a837cadad54b4.tar.gz
bcm5719-llvm-6a14325dffb7a0607e5b3c75d93a837cadad54b4.zip
[SampleFDO] Add FunctionOffsetTable in compact binary format profile.
The patch saves a function offset table which maps function name index to the offset of its function profile to the start of the binary profile. By using the function offset table, for those function profiles which will not be used when compiling a module, the profile reader does't have to read them. For profile size around 10~20M, it saves ~10% compile time. Differential Revision: https://reviews.llvm.org/D51863 llvm-svn: 342283
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/SampleProfile.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index b9b055d36f7..41ed0614af0 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -1515,6 +1515,7 @@ bool SampleProfileLoader::doInitialization(Module &M) {
return false;
}
Reader = std::move(ReaderOrErr.get());
+ Reader->collectFuncsToUse(M);
ProfileIsValid = (Reader->read() == sampleprof_error::success);
return true;
}
OpenPOWER on IntegriCloud