[llvm-commits] [llvm] r84226 - /llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
Evan Cheng
evan.cheng at apple.com
Thu Oct 15 17:33:09 PDT 2009
Author: evancheng
Date: Thu Oct 15 19:33:09 2009
New Revision: 84226
URL: http://llvm.org/viewvc/llvm-project?rev=84226&view=rev
Log:
When checking aliases between phi sources and V2, we know the sources are not themselves phi nodes. However, V2 may be. Call aliasCheck with V2 first to potentially eliminate a std::swap call.
Modified:
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=84226&r1=84225&r2=84226&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Thu Oct 15 19:33:09 2009
@@ -222,7 +222,7 @@
private:
// VisitedPHIs - Track PHI nodes visited by a aliasCheck() call.
- SmallSet<const PHINode*, 16> VisitedPHIs;
+ SmallPtrSet<const PHINode*, 16> VisitedPHIs;
// aliasGEP - Provide a bunch of ad-hoc rules to disambiguate a GEP instruction
// against another.
@@ -533,7 +533,7 @@
if (!VisitedPHIs.insert(PN))
return MayAlias;
- SmallSet<Value*, 4> UniqueSrc;
+ SmallPtrSet<Value*, 4> UniqueSrc;
SmallVector<Value*, 4> V1Srcs;
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
Value *PV1 = PN->getIncomingValue(i);
@@ -557,7 +557,7 @@
// NoAlias / MustAlias. Otherwise, returns MayAlias.
for (unsigned i = 1, e = V1Srcs.size(); i != e; ++i) {
Value *V = V1Srcs[i];
- AliasResult ThisAlias = aliasCheck(V, PNSize, V2, V2Size);
+ AliasResult ThisAlias = aliasCheck(V2, V2Size, V, PNSize);
if (ThisAlias != Alias || ThisAlias == MayAlias)
return MayAlias;
}
More information about the llvm-commits
mailing list