<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-04-28 18:45 GMT+02:00 Sanjoy Das <span dir="ltr"><<a href="mailto:sanjoy@playingwithpointers.com" target="_blank">sanjoy@playingwithpointers.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Piotr,<br>
<span class=""><br>
On Fri, Apr 28, 2017 at 9:18 AM, Piotr Padlewski via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Thanks guys.<br>
> Do you it make sense to extend the definition in LangRef?<br>
<br>
</span>If you're asking if it makes sense to allow nocapture on returned<br>
arguments, then I don't think it make sense. Right now we assume a<br>
pointer that only has nocapture uses is not captured. That will not<br>
be true with the spec change you're proposing.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div>No, I was making sure if I could mark invariant.group.barrier as nocapture, but since barrier returns the pointer it takes, I can't do it. </div><div><br></div><div>Piotr</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
-- Sanjoy<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> If so I will be<br>
> happy to upload a patch.<br>
><br>
> Piotr<br>
><br>
> 2017-04-28 17:58 GMT+02:00 Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>>:<br>
>><br>
>><br>
>><br>
>> On 04/28/2017 10:22 AM, Piotr Padlewski via llvm-dev wrote:<br>
>><br>
>> Hi,<br>
>> I have a question about semantics of nocapture attribute:<br>
>> "This indicates that the callee does not make any copies of the pointer<br>
>> that outlive the callee itself. "<br>
>> Is returing a pointer considered outliving callee? For example is this<br>
>> code valid:<br>
>><br>
>><br>
>> Yes, it includes returning the pointer. The code below is invalid. The<br>
>> return value outlives the callee itself.<br>
>><br>
>><br>
>> define i8* @foo(i8* nocapture %p)<br>
>> ret i8* %p<br>
>> }<br>
>><br>
>> The documentation also mention that " This is not a valid attribute for<br>
>> return values.", but I interpret that it is is about this case:<br>
>><br>
>> declare i8* nocapture @bar(i8* %p)<br>
>><br>
>><br>
>> Correct.<br>
>><br>
>> -Hal<br>
>><br>
>><br>
>> Piotr<br>
>><br>
>><br>
>> ______________________________<wbr>_________________<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/<wbr>mailman/listinfo/llvm-dev</a><br>
>><br>
>><br>
>> --<br>
>> Hal Finkel<br>
>> Lead, Compiler Technology and Programming Languages<br>
>> Leadership Computing Facility<br>
>> Argonne National Laboratory<br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<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/<wbr>mailman/listinfo/llvm-dev</a><br>
><br>
</div></div></blockquote></div><br></div></div>