[PATCH] CodeGen: Stick constant pool entries in COMDAT sections for WinCOFF

David Majnemer david.majnemer at gmail.com
Sat Jul 12 23:20:10 PDT 2014


Hi rafael, rnk, grosbach, echristo,

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.

http://reviews.llvm.org/D4482

Files:
  include/llvm/ADT/StringExtras.h
  include/llvm/CodeGen/AsmPrinter.h
  include/llvm/CodeGen/MachineConstantPool.h
  include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
  include/llvm/MC/MCSectionCOFF.h
  include/llvm/Target/TargetLoweringObjectFile.h
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  lib/CodeGen/MachineFunction.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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4482.11344.patch
Type: text/x-patch
Size: 22438 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140713/c7f11bc8/attachment.bin>


More information about the llvm-commits mailing list