diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunction.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86TargetObjectFile.cpp | 5 |
5 files changed, 18 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index a2823500fa6..e93299fccb2 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -852,6 +852,8 @@ MachineConstantPoolEntry::getSectionKind(const DataLayout *DL) const { return SectionKind::getMergeableConst8(); case 16: return SectionKind::getMergeableConst16(); + case 32: + return SectionKind::getMergeableConst32(); default: return SectionKind::getReadOnly(); } diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 624eaec73b4..4229741cf5a 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -270,9 +270,11 @@ selectELFSectionForGlobal(MCContext &Ctx, const GlobalValue *GV, EntrySize = 4; } else if (Kind.isMergeableConst8()) { EntrySize = 8; - } else { - assert(Kind.isMergeableConst16() && "unknown data width"); + } else if (Kind.isMergeableConst16()) { EntrySize = 16; + } else { + assert(Kind.isMergeableConst32() && "unknown data width"); + EntrySize = 32; } } @@ -375,6 +377,8 @@ MCSection *TargetLoweringObjectFileELF::getSectionForConstant( return MergeableConst8Section; if (Kind.isMergeableConst16() && MergeableConst16Section) return MergeableConst16Section; + if (Kind.isMergeableConst32() && MergeableConst32Section) + return MergeableConst32Section; if (Kind.isReadOnly()) return ReadOnlySection; diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index a3f9937f410..2948f69aee8 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -469,6 +469,10 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(Triple T) { Ctx->getELFSection(".rodata.cst16", ELF::SHT_PROGBITS, ELF::SHF_ALLOC | ELF::SHF_MERGE, 16, ""); + MergeableConst32Section = + Ctx->getELFSection(".rodata.cst32", ELF::SHT_PROGBITS, + ELF::SHF_ALLOC | ELF::SHF_MERGE, 32, ""); + StaticCtorSection = Ctx->getELFSection(".ctors", ELF::SHT_PROGBITS, ELF::SHF_ALLOC | ELF::SHF_WRITE); diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index 3c04a214fad..4169237aa30 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -202,6 +202,7 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalValue *GV, case 4: return SectionKind::getMergeableConst4(); case 8: return SectionKind::getMergeableConst8(); case 16: return SectionKind::getMergeableConst16(); + case 32: return SectionKind::getMergeableConst32(); default: return SectionKind::getReadOnly(); } diff --git a/llvm/lib/Target/X86/X86TargetObjectFile.cpp b/llvm/lib/Target/X86/X86TargetObjectFile.cpp index 0d37fcd1b43..e72f3a7a2e8 100644 --- a/llvm/lib/Target/X86/X86TargetObjectFile.cpp +++ b/llvm/lib/Target/X86/X86TargetObjectFile.cpp @@ -176,6 +176,11 @@ MCSection *X86WindowsTargetObjectFile::getSectionForConstant( COMDATSymName = "__xmm@" + scalarConstantToHexString(C); Align = 16; } + } else if (Kind.isMergeableConst32()) { + if (Align <= 32) { + COMDATSymName = "__ymm@" + scalarConstantToHexString(C); + Align = 32; + } } if (!COMDATSymName.empty()) |