1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 14:02:52 +02:00
llvm-mirror/test/Linker/Inputs
Duncan P. N. Exon Smith 6a8d2b6215 IR: Drop uniquing when an MDNode Value operand is deleted
This is a fix for PR28697.

An MDNode can indirectly refer to a GlobalValue, through a
ConstantAsMetadata.  When the GlobalValue is deleted, the MDNode operand
is reset to `nullptr`.  If the node is uniqued, this can lead to a
hard-to-detect cache invalidation in a Metadata map that's shared across
an LLVMContext.

Consider:

 1. A map from Metadata* to `T` called RemappedMDs.
 2. A node that references a global variable, `!{i1* @GV}`.
 3. Insert `!{i1* @GV} -> SomeT` in the map.
 4. Delete `@GV`, leaving behind `!{null} -> SomeT`.

Looking up the generic and uninteresting `!{null}` gives you `SomeT`,
which is likely related to `@GV`.  Worse, `SomeT`'s lifetime may be tied
to the deleted `@GV`.

This occurs in practice in the shared ValueMap used since r266579 in the
IRMover.  Other code that handles more than one Module (with different
lifetimes) in the same LLVMContext could hit it too.

The fix here is a partial revert of r225223: in the rare case that an
MDNode operand is a ConstantAsMetadata (i.e., wrapping a node from the
Value hierarchy), drop uniquing if it gets replaced with `nullptr`.
This changes step #4 above to leave behind `distinct !{null} -> SomeT`,
which can't be confused with the generic `!{null}`.

In theory, this can cause some churn in the LLVMContext's MDNode
uniquing map when Values are being deleted.  However:

  - The number of GlobalValues referenced from uniqued MDNodes is
    expected to be quite small.  E.g., the debug info metadata schema
    only references GlobalValues from distinct nodes.

  - Other Constants have the lifetime of the LLVMContext, whose teardown
    is careful to drop references before deleting the constants.

As a result, I don't expect a compile time regression from this change.

llvm-svn: 277625
2016-08-03 18:19:43 +00:00
..
apple-version
2003-01-30-LinkerRename.ll
2003-05-31-LinkerRename.ll
alias-2.ll
alias.ll
alignment.ll
available_externally_over_decl.ll
basiclink.a.ll
basiclink.b.ll
comdat2.ll
comdat3.ll
comdat4.ll
comdat5.ll
comdat8.ll
comdat11.ll
comdat13.ll
comdat14.ll
comdat15.ll
comdat16.ll
comdat-rm-dst.ll
comdat.ll
ConstantGlobals.ll
constructor-comdat.ll
ctors2.ll
ctors3.ll
ctors.ll
datalayout-a.ll
datalayout-b.ll
dicompositetype-unique.ll IR: Enable debug info type ODR uniquing for forward decls 2016-04-19 18:00:19 +00:00
distinct.ll
drop-debug.bc
funcimport2.ll
funcimport_appending_global.ll
funcimport_comdat.ll
funcimport.ll
ident.a.ll
ident.b.ll
internalize-lazy.ll
linkage2.ll
linkage.a.ll
linkage.b.ll
linkage.c.ll
mdlocation.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
metadata-function.ll
metadata-with-global-value-operand.ll IR: Drop uniquing when an MDNode Value operand is deleted 2016-08-03 18:19:43 +00:00
module-flags-dont-change-others.ll
module-flags-pic-1-b.ll
module-flags-pic-2-b.ll
odr.ll Don't verify inputs to the Linker if ODR merging. 2016-06-29 18:31:48 +00:00
old_global_ctors.3.4.bc
only-needed-debug-metadata.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
only-needed-named-metadata.ll
only-needed-recurse.ll Fix recursive -only-needed. 2016-04-21 14:56:33 +00:00
opaque.ll
override-different-linkage.ll
override-with-internal-linkage-2.ll
override-with-internal-linkage.ll
override.ll
pr21374.ll
pr22807-1.ll
pr22807-2.ll
pr26037.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
pr27044.ll Fix another case where we were unconditionally linking linkonce GVs. 2016-03-24 15:23:01 +00:00
PR8300.a.ll
PR8300.b.ll
PR11464.a.ll
PR11464.b.ll
redefinition.ll
replaced-function-matches-first-subprogram.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
subprogram-linkonce-weak.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
targettriple-a.ll
targettriple-b.ll
targettriple-c.ll
testlink.ll
thinlto_funcimport_debug.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
type-unique-alias.ll
type-unique-dst-types2.ll
type-unique-dst-types3.ll
type-unique-inheritance-a.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
type-unique-inheritance-b.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
type-unique-name.ll
type-unique-opaque.ll
type-unique-simple2-a.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
type-unique-simple2-b.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
type-unique-unrelated2.ll
type-unique-unrelated3.ll
unique-fwd-decl-b.ll
unique-fwd-decl-order.ll
visibility.ll