summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 3f70d2c904e..4661c086458 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -1533,6 +1533,11 @@ void Function::setEntryCount(ProfileCount Count,
auto PrevCount = getEntryCount();
assert(!PrevCount.hasValue() || PrevCount.getType() == Count.getType());
#endif
+
+ auto ImportGUIDs = getImportGUIDs();
+ if (S == nullptr && ImportGUIDs.size())
+ S = &ImportGUIDs;
+
MDBuilder MDB(getContext());
setMetadata(
LLVMContext::MD_prof,
OpenPOWER on IntegriCloud