summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2019-05-29 03:29:01 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2019-05-29 03:29:01 +0000
commit31fda09b2db405bbaa225bb6068c5f787506b9db (patch)
treec6571ccf7d6848532f8a4e92c9027a0fc9ed047a /llvm/lib/Bitcode/Reader
parent10c548cdfa1ebe15c0312d373191b09fbe7b6a3c (diff)
downloadbcm5719-llvm-31fda09b2db405bbaa225bb6068c5f787506b9db.tar.gz
bcm5719-llvm-31fda09b2db405bbaa225bb6068c5f787506b9db.zip
Add IR support, ELF section and user documentation for partitioning feature.
The partitioning feature was proposed here: http://lists.llvm.org/pipermail/llvm-dev/2019-February/130583.html This is mostly just documentation. The feature itself will be contributed in subsequent patches. Differential Revision: https://reviews.llvm.org/D60242 llvm-svn: 361923
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 412f99d5e62..b23115ba31d 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2892,7 +2892,8 @@ static void inferDSOLocal(GlobalValue *GV) {
Error BitcodeReader::parseGlobalVarRecord(ArrayRef<uint64_t> Record) {
// v1: [pointer type, isconst, initid, linkage, alignment, section,
// visibility, threadlocal, unnamed_addr, externally_initialized,
- // dllstorageclass, comdat, attributes, preemption specifier] (name in VST)
+ // dllstorageclass, comdat, attributes, preemption specifier,
+ // partition strtab offset, partition strtab size] (name in VST)
// v2: [strtab_offset, strtab_size, v1]
StringRef Name;
std::tie(Name, Record) = readNameFromStrtab(Record);
@@ -2983,6 +2984,10 @@ Error BitcodeReader::parseGlobalVarRecord(ArrayRef<uint64_t> Record) {
}
inferDSOLocal(NewGV);
+ // Check whether we have enough values to read a partition name.
+ if (Record.size() > 15)
+ NewGV->setPartition(StringRef(Strtab.data() + Record[14], Record[15]));
+
return Error::success();
}
@@ -3072,6 +3077,12 @@ Error BitcodeReader::parseFunctionRecord(ArrayRef<uint64_t> Record) {
}
inferDSOLocal(Func);
+ // Record[16] is the address space number.
+
+ // Check whether we have enough values to read a partition name.
+ if (Record.size() > 18)
+ Func->setPartition(StringRef(Strtab.data() + Record[17], Record[18]));
+
ValueList.push_back(Func);
// If this is a function with a body, remember the prototype we are
@@ -3149,6 +3160,13 @@ Error BitcodeReader::parseGlobalIndirectSymbolRecord(
NewGA->setDSOLocal(getDecodedDSOLocal(Record[OpNum++]));
inferDSOLocal(NewGA);
+ // Check whether we have enough values to read a partition name.
+ if (OpNum + 1 < Record.size()) {
+ NewGA->setPartition(
+ StringRef(Strtab.data() + Record[OpNum], Record[OpNum + 1]));
+ OpNum += 2;
+ }
+
ValueList.push_back(NewGA);
IndirectSymbolInits.push_back(std::make_pair(NewGA, Val));
return Error::success();
OpenPOWER on IntegriCloud