[llvm-dev] Alias scope and noalias metadata

181 views
Skip to first unread message

ramshankar r via llvm-dev

unread,
Jun 3, 2020, 11:02:34 AM6/3/20
to llvm...@lists.llvm.org
Hi there!

Greetings! I am wondering how I may be able get these annotations !noalias and !alias.scope to show up- I have a function with restrict added to the arguments but I do not see these intrinsics with clang -emit-llvm. Which pass inserts them?

Best,
Ram 

Johannes Doerfert via llvm-dev

unread,
Jun 3, 2020, 11:10:41 AM6/3/20
to ramshankar r, llvm...@lists.llvm.org

Hi Ram,


The inliner will translate `noalias` on an argument to those metadata annotations.


Cheers,

  Johannes

_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

ramshankar r via llvm-dev

unread,
Jun 3, 2020, 11:14:38 AM6/3/20
to Johannes Doerfert, llvm...@lists.llvm.org
OK, I see. So to be clear the code is in the inliner? I would like to explore if I can do it without inlining?!

Johannes Doerfert via llvm-dev

unread,
Jun 3, 2020, 11:20:33 AM6/3/20
to ramshankar r, llvm...@lists.llvm.org

The logic to do the transformation from `noalias` to that is in the inliner, I think.

You can use the metadata directly as well when you generate IR, I doubt there is a user hook from clang to do so.

There is an ongoing effort to replace/augment the alias metadata though as it is not sound and not suitable to use it for other things, e.g., local restrict pointers.

Hi Ram,


The inliner will translate `noalias` on an argument to those metadata
annotations.


Cheers,

  Johannes


On 6/3/20 10:02 AM, ramshankar r via llvm-dev wrote:

Hi there!

Greetings! I am wondering how I may be able get these annotations !noalias
and !alias.scope to show up- I have a function with restrict added to the
arguments but I do not see these intrinsics with clang -emit-llvm. Which
pass inserts them?

Best,
Ram



_______________________________________________
LLVM Developers mailing listll...@lists.llvm.orghttps://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



    
Reply all
Reply to author
Forward
0 new messages