[PATCH] D22744: CodeExtractor : Add ability to preserve profile data.
David Li via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 28 12:43:43 PDT 2016
davidxl accepted this revision.
davidxl added a comment.
This revision is now accepted and ready to land.
lgtm with the small issues (in new comments) fixed.
================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:744
@@ +743,3 @@
+ BlockFrequency EntryFreq;
+ bool HasProfileData = BFI && BPI;
+ if (HasProfileData) {
----------------
BPI check is not needed.
HasProfileData --> HasBFI because HasProfileData usually means real profile data exists (BFI can be statically computed).
================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:804
@@ +803,3 @@
+ BFI->getProfileCountFromFreq(EntryFreq.getFrequency());
+ if (OptEntryCount)
+ newFunction->setEntryCount(OptEntryCount.getValue());
----------------
if (OptEntryCount->hasValue())
https://reviews.llvm.org/D22744
More information about the llvm-commits
mailing list