<div dir="ltr">Sounds like it works!<div><br></div><div>Basically, adding these extra strip.invariant.group calls before pointer comparisons breaks the transform that was problematic. Presumably, clang would only strip invariant groups from pointers to dynamic types before casting them or using them in a comparison, so that the value equivalence optimization still works in the general case. The proposal trades value equivalence power for more devirtualization power.</div><div><br></div><div>One downside is that it may add many new IR instructions, but I don't see how to avoid them, as the whole point is to create distinct Value objects for use in the pointer equality comparison.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 19, 2018 at 4:31 PM Piotr Padlewski via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi folks,<div><br></div><div>here is a link to the proposal that we've been working on lately:</div><div><a href="https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing" target="_blank">https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing</a></div></div></blockquote></div></div>