commit 899898f000caf916105b48bd3d1855be5cbeb2fb
Author: ether <ethe...@gmail.com>
Date: Wed Apr 6 00:09:45 2011 +0800
ScopDetection: Add more debug printing code in isValidAffineFunction.
diff --git a/lib/Analysis/ScopDetection.cpp b/lib/Analysis/ScopDetection.cpp
index 389b490..5cd714b 100644
--- a/lib/Analysis/ScopDetection.cpp
+++ b/lib/Analysis/ScopDetection.cpp
@@ -98,6 +98,7 @@ bool ScopDetection::isValidAffineFunction(const SCEV *S, Region &RefRegion,
assert(S && "S must not be null!");
bool isMemoryAccess = (BasePtr != 0);
if (isMemoryAccess) *BasePtr = 0;
+ DEBUG(dbgs() << "Checking " << *S << " ... ");
if (isa<SCEVCouldNotCompute>(S)) {
DEBUG(dbgs() << "Non Affine: SCEV could not be computed\n");
@@ -129,7 +130,10 @@ bool ScopDetection::isValidAffineFunction(const SCEV *S, Region &RefRegion,
assert(I->second->isOne() && "Only one as pointer coefficient allowed.\n");
const SCEVUnknown *BaseAddr = dyn_cast<SCEVUnknown>(Var);
- if (!BaseAddr || isa<UndefValue>(BaseAddr->getValue())) return false;
+ if (!BaseAddr || isa<UndefValue>(BaseAddr->getValue())){
+ DEBUG(dbgs() << "Cannot handle base: " << *Var << "\n");
+ return false;
+ }
// BaseAddr must be invariant in Scop.
if (!isParameter(BaseAddr, RefRegion, *LI, *SE)) {
@@ -152,6 +156,7 @@ bool ScopDetection::isValidAffineFunction(const SCEV *S, Region &RefRegion,
return false;
}
+ DEBUG(dbgs() << " is affine.\n");
return !isMemoryAccess || (*BasePtr != 0);
}