<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 12:21 PM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">----- Original Message -----<br>
<br>
> From: "David Majnemer via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
> To: "Krzysztof Parzyszek" <<a href="mailto:kparzysz@codeaurora.org">kparzysz@codeaurora.org</a>><br>
> Cc: "llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>><br>
> Sent: Friday, December 4, 2015 11:16:29 AM<br>
<span class="">> Subject: Re: [llvm-dev] RFC: New function attribute<br>
> HasInaccessibleState<br>
<br>
</span><span class="">> I'd like to suggest a different direction which should accomplish<br>
> similar ends.<br>
<br>
> I think it would make sense to introduce an attribute: csecandidate.<br>
<br>
> If we see a call-site "X" marked as csecandidate, it would imply that<br>
> it can be replaced with any other call-site "Y" with the same<br>
> arguments which dominate the call-site at "X".<br>
<br>
> However, there are some cases that this would not be able to<br>
> optimize. For example, if we have two csecandidates ("X" and "Y")<br>
> which do not dominate one another.<br>
<br>
</span>Does this make it different than readnone?<br></blockquote><div><br></div><div>Depends on how you define readnone :)</div><div><br></div><div>If readnone is supposed to strictly refer to memory (but not other machine side effects), one might want intrinsics like rdrand to be readnone but not csecandidate.</div><div><br></div><div>I suppose the langref talks about control registers, perhaps that covers things like rdrand?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><br>
> This is solvable using another<br>
> attribute: speculatable. This attribute would tell us that we can<br>
> hoist the call out of arbitrary conditions. This would allow us to<br>
> move our csecandidate call-site to the common dominator of "X" and<br>
> "Y" and RAUW.<br>
<br>
</span>I agree that speculatable would be nice to have.<br>
<span class=""><font color="#888888"><br>
-Hal<br>
</font></span><span class="im"><br>
> On Fri, Dec 4, 2015 at 8:54 AM, Krzysztof Parzyszek via llvm-dev <<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a> > wrote:<br>
<br>
> > On 12/4/2015 10:48 AM, Vaivaswatha Nagaraj via llvm-dev wrote:<br>
><br>
<br>
> > > This point however reminds me to add, functions that transitively<br>
> > > call<br>
> ><br>
><br>
> > > functions with HasInaccessibleState must also have the flag set.<br>
> ><br>
><br>
<br>
> > That's in practice impossible to guarantee, both by the compiler<br>
> > and<br>
> > by the programmer.<br>
><br>
<br>
> > -Krzysztof<br>
><br>
<br>
> > --<br>
><br>
> > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,<br>
> > hosted by The Linux Foundation<br>
><br>
<br>
> > _______________________________________________<br>
><br>
> > LLVM Developers mailing list<br>
><br>
> > <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
><br>
> > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
><br>
<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</span><div class=""><div class="h5">--<br>
<br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</div></div></blockquote></div><br></div></div>