[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
Mon Feb 15 14:39:08 PST 2021
dexonsmith added a comment.
In D41669#2564233 <https://reviews.llvm.org/D41669#2564233>, @dexonsmith wrote:
> In D41669#2564112 <https://reviews.llvm.org/D41669#2564112>, @tejohnson wrote:
>
>> Yes it's being discarded. And yes it is already using RF_ReuseAndMutateDistinctMDs (set by default on the IRLinker constructor initialization of the ValueMapper). Hmm, now I'm confused. The case I modified in this patch is where this flag is not set. Aha - going through the debugger for the test case included with this patch shows that while the importer itself uses a ValueMapper with RF_ReuseAndMutateDistinctMDs enabled, the functionality that imports an alias as a copy of the aliasee (replaceAliasWithAliaseee) in fact uses CloneFunction/CloneFunctionInto, so a ValueMapper without that flag. So perhaps your fix in D96531 <https://reviews.llvm.org/D96531> is sufficient and this change can be reverted?
>
> Your logic SGTM -- replaceAliasWithAliasee DOES use CloneFunction -- but as mentioned above the test is failing for me. I'm confused... maybe my tree is out-of-date, or maybe there's something subtle going on... I'll reply again if I figure it out.
Looking at it in a debugger, I think I just need to update CloneFunctionInto to catch this case as well.
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