Fix AddAliasScopeMetadata again - alias.scope must be a complete description
authorHal Finkel <hfinkel@anl.gov>
Mon, 1 Sep 2014 04:26:40 +0000 (04:26 +0000)
committerHal Finkel <hfinkel@anl.gov>
Mon, 1 Sep 2014 04:26:40 +0000 (04:26 +0000)
commit55815634573b7157e010e1110a3209ff434a6947
treea845c4f1abf57a8d83b0339845e3a8e38c4db215
parentd43e6df10b85ee4a4dfd8dc164eff1177d4eb8d2
Fix AddAliasScopeMetadata again - alias.scope must be a complete description

I thought that I had fixed this problem in r216818, but I did not do a very
good job. The underlying issue is that when we add alias.scope metadata we are
asserting that this metadata completely describes the aliasing relationships
within the current aliasing scope domain, and so in the context of translating
noalias argument attributes, the pointers must all be based on noalias
arguments (as underlying objects) and have no other kind of underlying object.
In r216818 excluding appropriate accesses from getting alias.scope metadata is
done by looking for underlying objects that are not identified function-local
objects -- but that's wrong because allocas, etc. are also function-local
objects and we need to explicitly check that all underlying objects are the
noalias arguments for which we're adding metadata aliasing scopes.

This fixes the underlying-object check for adding alias.scope metadata, and
does some refactoring of the related capture-checking eligibility logic (and
adds more comments; hopefully making everything a bit clearer).

Fixes self-hosting on x86_64 with -mllvm -enable-noalias-to-md-conversion (the
feature is still disabled by default).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216863 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/InlineFunction.cpp
test/Transforms/Inline/noalias-calls.ll