summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-26 22:16:44 +0000
committerChris Lattner <sabre@nondot.org>2005-03-26 22:16:44 +0000
commit68ee8f572c1903461b815cc24a9b496045fefec9 (patch)
tree527a3c04401efa238b9f6902058bf2671676d5e5 /llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
parent518a994b7dcc6548992714560d30c83a1655b59d (diff)
downloadbcm5719-llvm-68ee8f572c1903461b815cc24a9b496045fefec9.tar.gz
bcm5719-llvm-68ee8f572c1903461b815cc24a9b496045fefec9.zip
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. llvm-svn: 20866
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysisEvaluator.cpp')
-rw-r--r--llvm/lib/Analysis/AliasAnalysisEvaluator.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
index 1b3daba0ab4..da8e4e8e627 100644
--- a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud