Copy noalias metadata from call sites to inlined instructions
authorHal Finkel <hfinkel@anl.gov>
Thu, 14 Aug 2014 21:09:37 +0000 (21:09 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 14 Aug 2014 21:09:37 +0000 (21:09 +0000)
commite1e7862f6e671b60e83476a09b9a1a27aceecfb9
tree06127ff43413c264a1ddf88782f2510c5a137243
parent6398a7f5fd89996cd8c5f67aac3da5fd73924f3b
Copy noalias metadata from call sites to inlined instructions

When a call site with noalias metadata is inlined, that metadata can be
propagated directly to the inlined instructions (only those that might access
memory because it is not useful on the others). Prior to inlining, the noalias
metadata could express that a call would not alias with some other memory
access, which implies that no instruction within that called function would
alias. By propagating the metadata to the inlined instructions, we preserve
that knowledge.

This should complete the enhancements requested in PR20500.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215676 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/InlineFunction.cpp
test/Transforms/Inline/noalias-cs.ll [new file with mode: 0644]