summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-11-09 01:45:13 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-11-09 01:45:13 +0000
commitb6a11a78794b196cf8cda59d584cbe0d3243c06b (patch)
tree74cf2737ddc2774f124f18691a3bf8050c9b12ef /llvm/lib/Bitcode
parent0695e5b916c8d4196fd586ce3a08a87f182fae44 (diff)
downloadbcm5719-llvm-b6a11a78794b196cf8cda59d584cbe0d3243c06b.tar.gz
bcm5719-llvm-b6a11a78794b196cf8cda59d584cbe0d3243c06b.zip
Revert "[ThinLTO] Prevent exporting of locals used/defined in module level asm"
This reverts commit r286297. Introduces a dependency from libAnalysis to libObject, which I missed during the review. llvm-svn: 286329
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 7b49aac006f..8de61bc0b7c 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -3327,16 +3327,11 @@ void ModuleBitcodeWriter::writePerModuleFunctionSummaryRecord(
void ModuleBitcodeWriter::writeModuleLevelReferences(
const GlobalVariable &V, SmallVector<uint64_t, 64> &NameVals,
unsigned FSModRefsAbbrev) {
- auto Summaries =
- Index->findGlobalValueSummaryList(GlobalValue::getGUID(V.getName()));
- if (Summaries == Index->end()) {
- // Only declarations should not have a summary (a declaration might however
- // have a summary if the def was in module level asm).
- assert(V.isDeclaration());
+ // Only interested in recording variable defs in the summary.
+ if (V.isDeclaration())
return;
- }
- auto *Summary = Summaries->second.front().get();
NameVals.push_back(VE.getValueID(&V));
+ auto *Summary = Index->getGlobalValueSummary(V);
GlobalVarSummary *VS = cast<GlobalVarSummary>(Summary);
NameVals.push_back(getEncodedGVSummaryFlags(VS->flags()));
@@ -3414,20 +3409,14 @@ void ModuleBitcodeWriter::writePerModuleGlobalValueSummary() {
// Iterate over the list of functions instead of the Index to
// ensure the ordering is stable.
for (const Function &F : M) {
+ if (F.isDeclaration())
+ continue;
// Summary emission does not support anonymous functions, they have to
// renamed using the anonymous function renaming pass.
if (!F.hasName())
report_fatal_error("Unexpected anonymous function when writing summary");
- auto Summaries =
- Index->findGlobalValueSummaryList(GlobalValue::getGUID(F.getName()));
- if (Summaries == Index->end()) {
- // Only declarations should not have a summary (a declaration might
- // however have a summary if the def was in module level asm).
- assert(F.isDeclaration());
- continue;
- }
- auto *Summary = Summaries->second.front().get();
+ auto *Summary = Index->getGlobalValueSummary(F);
writePerModuleFunctionSummaryRecord(NameVals, Summary, VE.getValueID(&F),
FSCallsAbbrev, FSCallsProfileAbbrev, F);
}
OpenPOWER on IntegriCloud