[ScopedNoAliasAA] Only collect noalias nodes if we have alias.scope nodes

No functional change is intended.

llvm-svn: 278646
This commit is contained in:
David Majnemer 2016-08-15 02:23:50 +00:00
parent ddc7ab26fc
commit 8b8869f8ef
1 changed files with 4 additions and 2 deletions

View File

@ -151,12 +151,14 @@ bool ScopedNoAliasAAResult::mayAliasInScopes(const MDNode *Scopes,
// We alias unless, for some domain, the set of noalias scopes in that domain
// is a superset of the set of alias scopes in that domain.
for (const MDNode *Domain : Domains) {
SmallPtrSet<const MDNode *, 16> NANodes, ScopeNodes;
collectMDInDomain(NoAlias, Domain, NANodes);
SmallPtrSet<const MDNode *, 16> ScopeNodes;
collectMDInDomain(Scopes, Domain, ScopeNodes);
if (ScopeNodes.empty())
continue;
SmallPtrSet<const MDNode *, 16> NANodes;
collectMDInDomain(NoAlias, Domain, NANodes);
// To not alias, all of the nodes in ScopeNodes must be in NANodes.
bool FoundAll = true;
for (const MDNode *SMD : ScopeNodes)