[llvm-dev] Return on nocapture pointer
Reid Kleckner via llvm-dev
llvm-dev at lists.llvm.org
Fri Apr 28 08:58:04 PDT 2017
I believe it is invalid. It's making a copy that outlives the call. I don't
think functionattrs will infer this, for example.
On Fri, Apr 28, 2017 at 8:22 AM, Piotr Padlewski via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> I have a question about semantics of nocapture attribute:
> "This indicates that the callee does not make any copies of the pointer
> that outlive the callee itself. "
> Is returing a pointer considered outliving callee? For example is this
> code valid:
> define i8* @foo(i8* nocapture %p)
> ret i8* %p
> The documentation also mention that " This is not a valid attribute for
> return values.", but I interpret that it is is about this case:
> declare i8* nocapture @bar(i8* %p)
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev