[cfe-dev] [LLVMdev] Clang devirtualization proposal

Piotr Padlewski prazek at google.com
Fri Jul 31 16:05:07 PDT 2015


On Fri, Jul 31, 2015 at 3:53 PM, Philip Reames <listmail at philipreames.com>
wrote:
>
> Quoting from the google doc: "If we don’t know definition of some
> function, we assume that it will not call @llvm.invariant.group.barrier().
> "
> This part really really bugs me.  We generally try to assume minimal
> knowledge of external functions (i.e. they can do anything) and this
> assumption would invert that.  Is there a way we can rephrase the proposal
> which avoids the need for this?  I'm not quite clear what this assumption
> buys us.
>
> This is because without it the optimization will be useless. For example:
A* a = new A;
a->foo(); //outline virtual
a->foo();

If we will assume that foo calls @llvm.invariant.barrier, then we will not
be able to optimize the second call.


Piotr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150731/680b60f5/attachment.html>


More information about the cfe-dev mailing list