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?
The inliner will translate
noalias on an argument to those metadata annotations.
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?!
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.