[PATCH] Internalize: internalize comdat members as a group, and drop comdat on such members.

Peter Collingbourne peter at pcc.me.uk
Tue Jun 23 17:39:10 PDT 2015


Hi majnemer,

Internalizing an individual comdat group member without also internalizing
the other members of the comdat can break comdat semantics. For example,
if a module contains a reference to an internalized comdat member, and the
linker chooses a comdat group from a different object file, this will break
the reference to the internalized member.

This change causes the internalizer to only internalize comdat members if all
other members of the comdat are not externally visible. Once a comdat group
has been fully internalized, there is no need to apply comdat rules to its
members; later optimization passes (e.g. globaldce) can legally drop individual
members of the comdat. So we drop the comdat attribute from all comdat members.

http://reviews.llvm.org/D10679

Files:
  lib/Transforms/IPO/Internalize.cpp
  test/Transforms/Internalize/comdat.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10679.28312.patch
Type: text/x-patch
Size: 7052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150624/8ec745fa/attachment.bin>


More information about the llvm-commits mailing list