summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer
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/Writer
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/Writer')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 7d9b0583d1e..00d6fe8e27c 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1262,7 +1262,8 @@ void ModuleBitcodeWriter::writeModuleInfo() {
GV.getDLLStorageClass() != GlobalValue::DefaultStorageClass ||
GV.hasComdat() ||
GV.hasAttributes() ||
- GV.isDSOLocal()) {
+ GV.isDSOLocal() ||
+ GV.hasPartition()) {
Vals.push_back(getEncodedVisibility(GV));
Vals.push_back(getEncodedThreadLocalMode(GV));
Vals.push_back(getEncodedUnnamedAddr(GV));
@@ -1274,6 +1275,8 @@ void ModuleBitcodeWriter::writeModuleInfo() {
Vals.push_back(VE.getAttributeListID(AL));
Vals.push_back(GV.isDSOLocal());
+ Vals.push_back(addToStrtab(GV.getPartition()));
+ Vals.push_back(GV.getPartition().size());
} else {
AbbrevToUse = SimpleGVarAbbrev;
}
@@ -1311,6 +1314,8 @@ void ModuleBitcodeWriter::writeModuleInfo() {
Vals.push_back(F.isDSOLocal());
Vals.push_back(F.getAddressSpace());
+ Vals.push_back(addToStrtab(F.getPartition()));
+ Vals.push_back(F.getPartition().size());
unsigned AbbrevToUse = 0;
Stream.EmitRecord(bitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse);
@@ -1333,6 +1338,8 @@ void ModuleBitcodeWriter::writeModuleInfo() {
Vals.push_back(getEncodedThreadLocalMode(A));
Vals.push_back(getEncodedUnnamedAddr(A));
Vals.push_back(A.isDSOLocal());
+ Vals.push_back(addToStrtab(A.getPartition()));
+ Vals.push_back(A.getPartition().size());
unsigned AbbrevToUse = 0;
Stream.EmitRecord(bitc::MODULE_CODE_ALIAS, Vals, AbbrevToUse);
@@ -1351,6 +1358,8 @@ void ModuleBitcodeWriter::writeModuleInfo() {
Vals.push_back(getEncodedLinkage(I));
Vals.push_back(getEncodedVisibility(I));
Vals.push_back(I.isDSOLocal());
+ Vals.push_back(addToStrtab(I.getPartition()));
+ Vals.push_back(I.getPartition().size());
Stream.EmitRecord(bitc::MODULE_CODE_IFUNC, Vals);
Vals.clear();
}
OpenPOWER on IntegriCloud