[PATCH] D67286: [Attributor] Implement "noalias" callsite argument deduction

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 6 11:37:25 PDT 2019


jdoerfert added inline comments.


================
Comment at: llvm/test/Transforms/FunctionAttrs/noalias_returned.ll:235
+  ret void
+}
----------------
uenoku wrote:
> jdoerfert wrote:
> > We need to make sure this test works as well:
> > 
> > ```
> > define void @test12_3(){
> >   %A = tail call noalias i8* @malloc(i64 4)
> >   tail call void @two_args(i8* %A, i8* %A)
> >   ret void
> > }
> > ```
> If @two_args is:
> ```
> declare void @two_args(i8* nocapture , i8* nocapture)
> ```
> then
> ```
> define void @test12_3(){
>   %A = tail call noalias i8* @malloc(i64 4)
>   tail call void @two_args(i8* noalias nocapture %A, i8* noalias nocapture%A)
>   ret void
> }
> ```
> (If either argument is not marked as `nocapture`, there is no problem.)
> It is not good ... I'll fix. We need to compare the call site argument and ensure that there is no copy.
> 
> 
> We need to compare the call site argument and ensure that there is no copy.

Exactly. They need to be checked for aliases wrt. other arguments.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67286/new/

https://reviews.llvm.org/D67286





More information about the llvm-commits mailing list