[PATCH] D41669: Teach ValueMapper to use ODR uniqued types when available

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 16:25:04 PST 2021


dexonsmith added a comment.
Herald added subscribers: steven_wu, hiraditya.
Herald added a project: LLVM.

This is unsound, as it breaks CloneModule: it causes the original/cloned module to reference GlobalValues from the new module (composite types transitively reference global values when a type has "interesting" template parameters). See https://bugs.llvm.org/show_bug.cgi?id=48841 (especially https://bugs.llvm.org/show_bug.cgi?id=48841#c22, where I have a long explanation).

@tejohnson, can you share more context about why this was necessary? How is ThinLTO using the value mapper that this happens?

There should be another way to get this optimization that's sound, but I think it'll involve priming the ValueToValueMap that gets sent into MapValue / MapMetadata.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D41669/new/

https://reviews.llvm.org/D41669



More information about the llvm-commits mailing list