Skip to content

Commit 586066d

Browse files
committed
Replace isMustAliasMerge by immediately invoked lambda
1 parent fa1c8e4 commit 586066d

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

llvm/lib/Analysis/AliasSetTracker.cpp

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,6 @@ static cl::opt<unsigned>
4040
cl::desc("The maximum number of pointers may-alias "
4141
"sets may contain before degradation"));
4242

43-
/// For the given two alias sets, when known that the sets are must-aliases
44-
/// individually, check whether their union preserves the must-alias status.
45-
static bool isMustAliasMerge(const AliasSet &AS, const AliasSet &OtherAS,
46-
BatchAAResults &BatchAA) {
47-
// Since the sets are must-aliases individually, we must only check
48-
// the pairs across the sets.
49-
for (const MemoryLocation &MemLoc : AS)
50-
for (const MemoryLocation &OtherMemLoc : OtherAS)
51-
if (!BatchAA.isMustAlias(MemLoc, OtherMemLoc))
52-
return false;
53-
return true;
54-
}
55-
5643
/// mergeSetIn - Merge the specified alias set into this alias set.
5744
void AliasSet::mergeSetIn(AliasSet &AS, AliasSetTracker &AST,
5845
BatchAAResults &BatchAA) {
@@ -66,8 +53,14 @@ void AliasSet::mergeSetIn(AliasSet &AS, AliasSetTracker &AST,
6653
if (Alias == SetMustAlias) {
6754
// Check that these two merged sets really are must aliases.
6855
// If the pointers are not a must-alias pair, this set becomes a may alias.
69-
if (!isMustAliasMerge(*this, AS, BatchAA))
70-
Alias = SetMayAlias;
56+
[&] {
57+
for (const MemoryLocation &MemLoc : *this)
58+
for (const MemoryLocation &ASMemLoc : AS)
59+
if (!BatchAA.isMustAlias(MemLoc, ASMemLoc)) {
60+
Alias = SetMayAlias;
61+
return;
62+
}
63+
}();
7164
}
7265

7366
// Merge the list of constituent pointers...

0 commit comments

Comments
 (0)