[llvm-commits] [llvm] r77359 - in /llvm/trunk: include/llvm/Analysis/LoopDependenceAnalysis.h lib/Analysis/LoopDependenceAnalysis.cpp
Andreas Bolka
a at bolka.at
Tue Jul 28 12:50:13 PDT 2009
Author: abolka
Date: Tue Jul 28 14:50:13 2009
New Revision: 77359
URL: http://llvm.org/viewvc/llvm-project?rev=77359&view=rev
Log:
Simplify LDA-internal interface.
Modified:
llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h
llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp
Modified: llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h?rev=77359&r1=77358&r2=77359&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopDependenceAnalysis.h Tue Jul 28 14:50:13 2009
@@ -62,7 +62,7 @@
bool findOrInsertDependencePair(Value*, Value*, DependencePair*&);
/// TODO: doc
- void analysePair(DependencePair *P) const;
+ DependenceResult analysePair(DependencePair *P) const;
public:
static char ID; // Class identification, replacement for typeinfo
Modified: llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp?rev=77359&r1=77358&r2=77359&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopDependenceAnalysis.cpp Tue Jul 28 14:50:13 2009
@@ -116,18 +116,15 @@
return false;
}
-void LoopDependenceAnalysis::analysePair(DependencePair *P) const {
+LoopDependenceAnalysis::DependenceResult
+LoopDependenceAnalysis::analysePair(DependencePair *P) const {
DEBUG(errs() << "Analysing:\n" << *P->A << "\n" << *P->B << "\n");
- // Our default answer: we don't know anything, i.e. we failed to analyse this
- // pair to get a more specific answer (dependent, independent).
- P->Result = Unknown;
-
// We only analyse loads and stores but no possible memory accesses by e.g.
// free, call, or invoke instructions.
if (!IsLoadOrStoreInst(P->A) || !IsLoadOrStoreInst(P->B)) {
DEBUG(errs() << "--> [?] no load/store\n");
- return;
+ return Unknown;
}
Value *aPtr = GetPointerOperand(P->A);
@@ -137,20 +134,20 @@
case AliasAnalysis::MayAlias:
// We can not analyse objects if we do not know about their aliasing.
DEBUG(errs() << "---> [?] may alias\n");
- return;
+ return Unknown;
case AliasAnalysis::NoAlias:
// If the objects noalias, they are distinct, accesses are independent.
DEBUG(errs() << "---> [I] no alias\n");
- P->Result = Independent;
- return;
+ return Independent;
case AliasAnalysis::MustAlias:
break; // The underlying objects alias, test accesses for dependence.
}
+ // We failed to analyse this pair to get a more specific answer.
DEBUG(errs() << "---> [?] cannot analyse\n");
- return;
+ return Unknown;
}
bool LoopDependenceAnalysis::depends(Value *A, Value *B) {
@@ -161,8 +158,7 @@
if (!findOrInsertDependencePair(A, B, p)) {
// The pair is not cached, so analyse it.
++NumAnalysed;
- analysePair(p);
- switch (p->Result) {
+ switch (p->Result = analysePair(p)) {
case Dependent: ++NumDependent; break;
case Independent: ++NumIndependent; break;
case Unknown: ++NumUnknown; break;
More information about the llvm-commits
mailing list