[cfe-dev] RFC: Devirtualization v2

Reid Kleckner via cfe-dev cfe-dev at lists.llvm.org
Tue Mar 20 14:14:13 PDT 2018


Sounds like it works!

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.

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.

On Mon, Mar 19, 2018 at 4:31 PM Piotr Padlewski via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi folks,
>
> here is a link to the proposal that we've been working on lately:
>
> https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180320/762ec145/attachment.html>


More information about the cfe-dev mailing list