diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-26 22:16:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-26 22:16:44 +0000 |
commit | 0772e78789124ca8b747bdc6f9756a5e944bc8f3 (patch) | |
tree | d4b25c3fcc1784bbb79cb82a18b8943d43422009 /lib/Analysis/AliasAnalysisEvaluator.cpp | |
parent | 7532e2f55554b9f7944a358931a22f74f8dd226e (diff) |
Interchange this loop so that we test all pointers against one call site
before moving on to the next call site. This will be a more efficient way
to compute the mod/ref set for AA implementations like DSA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/AliasAnalysisEvaluator.cpp')
-rw-r--r-- | lib/Analysis/AliasAnalysisEvaluator.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp index 1b3daba0ab..da8e4e8e62 100644 --- a/lib/Analysis/AliasAnalysisEvaluator.cpp +++ b/lib/Analysis/AliasAnalysisEvaluator.cpp @@ -156,15 +156,16 @@ bool AAEval::runOnFunction(Function &F) { } // Mod/ref alias analysis: compare all pairs of calls and values - for (std::set<Value *>::iterator V = Pointers.begin(), Ve = Pointers.end(); - V != Ve; ++V) { - unsigned Size = 0; - const Type *ElTy = cast<PointerType>((*V)->getType())->getElementType(); - if (ElTy->isSized()) Size = TD.getTypeSize(ElTy); - - for (std::set<CallSite>::iterator C = CallSites.begin(), - Ce = CallSites.end(); C != Ce; ++C) { - Instruction *I = C->getInstruction(); + for (std::set<CallSite>::iterator C = CallSites.begin(), + Ce = CallSites.end(); C != Ce; ++C) { + Instruction *I = C->getInstruction(); + + for (std::set<Value *>::iterator V = Pointers.begin(), Ve = Pointers.end(); + V != Ve; ++V) { + unsigned Size = 0; + const Type *ElTy = cast<PointerType>((*V)->getType())->getElementType(); + if (ElTy->isSized()) Size = TD.getTypeSize(ElTy); + switch (AA.getModRefInfo(*C, *V, Size)) { case AliasAnalysis::NoModRef: PrintModRefResults("NoModRef", PrintNoModRef, I, *V, F.getParent()); @@ -183,7 +184,7 @@ bool AAEval::runOnFunction(Function &F) { } } } - + return false; } |