[polly] r292125 - ScopInfo: no need to clear alias group explicitly
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 16 06:13:01 PST 2017
Author: grosser
Date: Mon Jan 16 08:13:01 2017
New Revision: 292125
URL: http://llvm.org/viewvc/llvm-project?rev=292125&view=rev
Log:
ScopInfo: no need to clear alias group explicitly
The alias group will anyhow be cleared at the end of this function and is not
used afterwards. We avoid an explicit clear() call at multiple places to
improve readability of this code.
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=292125&r1=292124&r2=292125&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Mon Jan 16 08:13:01 2017
@@ -2981,10 +2981,8 @@ bool Scop::buildAliasGroups(AliasAnalysi
MapVector<const Value *, SmallSetVector<MemoryAccess *, 8>> ReadOnlyPairs;
SmallPtrSet<const Value *, 4> NonReadOnlyBaseValues;
- if (AG.size() < 2) {
- AG.clear();
+ if (AG.size() < 2)
continue;
- }
for (auto II = AG.begin(); II != AG.end();) {
emitOptimizationRemarkAnalysis(
@@ -3004,16 +3002,12 @@ bool Scop::buildAliasGroups(AliasAnalysi
// If we don't have read only pointers check if there are at least two
// non read only pointers, otherwise clear the alias group.
- if (ReadOnlyPairs.empty() && NonReadOnlyBaseValues.size() <= 1) {
- AG.clear();
+ if (ReadOnlyPairs.empty() && NonReadOnlyBaseValues.size() <= 1)
continue;
- }
// If we don't have non read only pointers clear the alias group.
- if (NonReadOnlyBaseValues.empty()) {
- AG.clear();
+ if (NonReadOnlyBaseValues.empty())
continue;
- }
// Check if we have non-affine accesses left, if so bail out as we cannot
// generate a good access range yet.
More information about the llvm-commits
mailing list