[llvm-dev] alias.scope and local restricted C pointers

Bekket McClane via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 16 17:52:29 PDT 2018



> On Aug 16, 2018, at 4:41 PM, Troy Johnson via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Concerning slide 16 of https://llvm.org/devmtg/2017-02-04/Restrict-Qualified-Pointers-in-LLVM.pdf <https://llvm.org/devmtg/2017-02-04/Restrict-Qualified-Pointers-in-LLVM.pdf>
>  
> Specifically “Currently, LLVM only supports restrict on function arguments, although we have a way to preserve that information if the function is inlined.”
>  
> Is that statement still accurate? 

Yes, correct (actually I was just working on restrict, no_alias and alias.scope attributes). The inliner also propagates them correctly. 

> It would seem that https://llvm.org/docs/LangRef.html#noalias-and-alias-scope-metadata <https://llvm.org/docs/LangRef.html#noalias-and-alias-scope-metadata> should be sufficiently general to honor C’s restrict qualifier on local pointers,
> but it does not appear that Clang uses this part of LLVM’s IR for that purpose today and thus local restricts are ignored.

I think that’s correct, but I haven’t come out with any scenarios regarding local variables/memory that can _not_ be solved by AA. As BasicAA is able to solved most of the local cases, including malloc and some memory intrinsics.

Best
Bekket
>  
> Thanks,
> Troy
>  
>  
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180816/1f2d64ab/attachment.html>


More information about the llvm-dev mailing list