<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">IIRC, sharing uniqued metadata across modules should <i class="">only</i> happen as a temporary state.  It's a trick for when loading modules that will be merged together, to avoid unnecessarily creating multiple copies of the graphs.<div class=""><br class=""></div><div class="">I feel like the verifier should reject this state, unless it's specifically being called in a context where modules-to-be-merged are still being loaded.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 11, 2018, at 23:33, Roman Tereshin via Phabricator <<a href="mailto:reviews@reviews.llvm.org" class="">reviews@reviews.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">rtereshin added a comment.<br class=""><br class=""><blockquote type="cite" class="">Value::~Value() calls out ValueAsMetadata::handleDeletion() so it seems like it would not leave a stale reference<br class=""></blockquote><br class="">Looks like it. On the other hand, I would think that referencing a value from a different module is more tolerable if there is no copy of that value in the module directly referencing the metadata node. In all the tests cases we've got so far however it's not the case as the value referenced always has a copy in every module involved, so it seems having these cross-module references is just calling for trouble. Especially given this fair consideration:<br class=""><br class=""><blockquote type="cite" class="">I'm also not sure if the code that handles DITemplateValueParameters would handle null Metadata entries well.<br class=""></blockquote><br class="">Even if it does, it's a loss of information for no apparent reason.<br class=""><br class=""><br class="">Repository:<br class="">  rL LLVM<br class=""><br class=""><a href="https://reviews.llvm.org/D47969" class="">https://reviews.llvm.org/D47969</a><br class=""><br class=""><br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>