CodeGen: Stick constant pool entries in COMDAT sections for WinCOFF
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 14 Jul 2014 22:57:27 +0000 (22:57 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 14 Jul 2014 22:57:27 +0000 (22:57 +0000)
commit38d8be1ad8971b3ca227051521120a386d474d07
tree7a210821570fa1756c7cda979655b37f018a6509
parente077a904c83d5eb52c9ff666b35f46078e8b604a
CodeGen: Stick constant pool entries in COMDAT sections for WinCOFF

COFF lacks a feature that other object file formats support: mergeable
sections.

To work around this, MSVC sticks constant pool entries in special COMDAT
sections so that each constant is in it's own section.  This permits
unused constants to be dropped and it also allows duplicate constants in
different translation units to get merged together.

This fixes PR20262.

Differential Revision: http://reviews.llvm.org/D4482

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213006 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
include/llvm/MC/MCSectionCOFF.h
include/llvm/Target/TargetLoweringObjectFile.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
lib/MC/MCContext.cpp
lib/Target/NVPTX/NVPTXTargetObjectFile.h
lib/Target/TargetLoweringObjectFile.cpp
lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86AsmPrinter.h
lib/Target/X86/X86TargetObjectFile.cpp
lib/Target/X86/X86TargetObjectFile.h
lib/Target/XCore/XCoreTargetObjectFile.cpp
lib/Target/XCore/XCoreTargetObjectFile.h
test/CodeGen/X86/constant-pool-sharing.ll
test/CodeGen/X86/win_cst_pool.ll [new file with mode: 0644]