summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorShiva Chen <shiva0217@gmail.com>2019-04-11 04:59:13 +0000
committerShiva Chen <shiva0217@gmail.com>2019-04-11 04:59:13 +0000
commit7cc03bd06487313575c82264abf018098060f795 (patch)
tree0d3801115161a47c0a0dd1f996c738032e967248 /llvm/lib/CodeGen
parent98da442b6d77a20e45013e9df6c7480bea2f56e0 (diff)
downloadbcm5719-llvm-7cc03bd06487313575c82264abf018098060f795.tar.gz
bcm5719-llvm-7cc03bd06487313575c82264abf018098060f795.zip
[RISCV] Put data smaller than eight bytes to small data section
Because of gp = sdata_start_address + 0x800, gp with signed twelve-bit offset could covert most of the small data section. Linker relaxation could transfer the multiple data accessing instructions to a gp base with signed twelve-bit offset instruction. Differential Revision: https://reviews.llvm.org/D57493 llvm-svn: 358150
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index fe22e946c16..d34254699ed 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -259,6 +259,9 @@ bool AsmPrinter::doInitialization(Module &M) {
const_cast<TargetLoweringObjectFile&>(getObjFileLowering())
.Initialize(OutContext, TM);
+ const_cast<TargetLoweringObjectFile &>(getObjFileLowering())
+ .getModuleMetadata(M);
+
OutStreamer->InitSections(false);
// Emit the version-min deployment target directive if needed.
OpenPOWER on IntegriCloud