[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-dev
Subject:    Re: [LLVMdev] Clang devirtualization proposal
From:       Piotr Padlewski <prazek () google ! com>
Date:       2015-07-31 23:05:07
Message-ID: CABUQfFpPaDVZZVCtMS3n6y5_d2htPgzP+xsHHjyvWBz7MQeijw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Fri, Jul 31, 2015 at 3:53 PM, Philip Reames <listmail@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

[Attachment #5 (text/html)]

<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul \
31, 2015 at 3:53 PM, Philip Reames <span dir="ltr">&lt;<a \
href="mailto:listmail@philipreames.com" \
target="_blank">listmail@philipreames.com</a>&gt;</span> wrote:<blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">  Quoting from the \
google doc: <span style="font-size:14.666666666666666px;font-family:Arial;color:#00000 \
0;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">&quot;If
  we don't know definition of some function, we assume that it will
      not call @llvm.invariant.group.barrier().</span>&quot;<br>
    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&#39;m not quite clear what
    this assumption buys us.<br><br></div></blockquote><div>This is because without \
it the optimization will be useless. For example:</div><div>A* a = new \
A;</div><div>a-&gt;foo(); //outline \
virtual</div><div>a-&gt;foo();</div><div><br></div><div>If we will assume that foo \
calls @llvm.invariant.barrier, then we will not be able to optimize the second call.  \
</div><div><br></div><div><br></div><div>Piotr</div></div></div></div>



_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic