ScopInfo: Fold SmallVectors used in alias check generation back into loop [NFC]

Hoisting small vectors out of a loop seems to be a pure performance
optimization, which is unlikely to have great impact in practice. As this
hoisting just increases code-complexity, we fold the SmallVectors back into
the loop.

In subsequent commits, we will further simplify and structure this code, but
we committed this change separately to provide an explanation to make clear
that we purposefully reverted this optimization.

llvm-svn: 292122
This commit is contained in:
Tobias Grosser 2017-01-16 14:08:02 +00:00
parent e39f9127f9
commit 92fd612c84

View File

@ -2976,11 +2976,9 @@ bool Scop::buildAliasGroups(AliasAnalysis &AA) {
splitAliasGroupsByDomain(AliasGroups);
auto &F = getFunction();
MapVector<const Value *, SmallSetVector<MemoryAccess *, 8>> ReadOnlyPairs;
SmallPtrSet<const Value *, 4> NonReadOnlyBaseValues;
for (AliasGroupTy &AG : AliasGroups) {
NonReadOnlyBaseValues.clear();
ReadOnlyPairs.clear();
MapVector<const Value *, SmallSetVector<MemoryAccess *, 8>> ReadOnlyPairs;
SmallPtrSet<const Value *, 4> NonReadOnlyBaseValues;
if (AG.size() < 2) {
AG.clear();