[llvm-commits] [polly] r137928 - in /polly/trunk: include/polly/TempScopInfo.h lib/Analysis/TempScopInfo.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Wed Aug 17 23:31:43 PDT 2011
Author: grosser
Date: Thu Aug 18 01:31:43 2011
New Revision: 137928
URL: http://llvm.org/viewvc/llvm-project?rev=137928&view=rev
Log:
TempSCoP: Store SCEV a SCEVAffFunc was derived from
Modified:
polly/trunk/include/polly/TempScopInfo.h
polly/trunk/lib/Analysis/TempScopInfo.cpp
Modified: polly/trunk/include/polly/TempScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/TempScopInfo.h?rev=137928&r1=137927&r2=137928&view=diff
==============================================================================
--- polly/trunk/include/polly/TempScopInfo.h (original)
+++ polly/trunk/include/polly/TempScopInfo.h Thu Aug 18 01:31:43 2011
@@ -46,6 +46,14 @@
LnrTransSet LnrTrans;
public:
+ // The scalar evolution expression from which we derived this affine
+ // expression.
+ //
+ // We will use it to directly translation from scalar expressions to the
+ // corresponding isl objects. As soon as this finished, most of SCEVAffFunc
+ // can be removed.
+ const SCEV *OriginalSCEV;
+
// The type of the scev affine function
enum SCEVAffFuncType {
None = 0,
@@ -72,11 +80,10 @@
/// @brief Create a new SCEV affine function with memory access type or
/// condition type
-
- explicit SCEVAffFunc(SCEVAffFuncType Type, unsigned elemBytes = 0,
- Value* baseAddr = 0)
- : TransComp(0), BaseAddr(baseAddr), ElemBytes(elemBytes),
- FuncType(Type), has_sign(true) {}
+ explicit SCEVAffFunc(SCEVAffFuncType Type, const SCEV *OriginalSCEV,
+ unsigned elemBytes = 0)
+ : TransComp(0), OriginalSCEV(OriginalSCEV), BaseAddr(0),
+ ElemBytes(elemBytes), FuncType(Type), has_sign(true) {}
/// @brief Construct a new SCEVAffFunc from a SCEV
///
Modified: polly/trunk/lib/Analysis/TempScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/TempScopInfo.cpp?rev=137928&r1=137927&r2=137928&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/TempScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/TempScopInfo.cpp Thu Aug 18 01:31:43 2011
@@ -42,6 +42,8 @@
assert(S && "S can not be null!");
assert(!isa<SCEVCouldNotCompute>(S) && "Non affine function in Scop");
+ OriginalSCEV = S;
+
for (AffineSCEVIterator I = affine_begin(S, SE), E = affine_end();
I != E; ++I) {
// The constant part must be a SCEVConstant.
@@ -294,7 +296,7 @@
return false;
}
-void TempScopInfo::buildAccessFunctions(Region &R, ParamSetType &Params,
+void TempScopInfo::buildAccessFunctions(Region &R, ParamSetType &Parameter,
BasicBlock &BB) {
AccFuncSetType Functions;
@@ -313,10 +315,11 @@
Type = SCEVAffFunc::WriteMem;
}
- Functions.push_back(std::make_pair(SCEVAffFunc(Type, Size), &Inst));
+ const SCEV *AccessFunction = SE->getSCEV(getPointerOperand(Inst));
+ Functions.push_back(
+ std::make_pair(SCEVAffFunc(Type, AccessFunction, Size), &Inst));
- Value *Ptr = getPointerOperand(Inst);
- buildAffineFunction(SE->getSCEV(Ptr), Functions.back().first, R, Params);
+ buildAffineFunction(AccessFunction, Functions.back().first, R, Parameter);
}
}
@@ -341,8 +344,8 @@
if (LoopBounds.find(L) != LoopBounds.end())
continue;
- LoopBounds[L] = SCEVAffFunc(SCEVAffFunc::Eq);
const SCEV *LoopCount = SE->getBackedgeTakenCount(L);
+ LoopBounds[L] = SCEVAffFunc(SCEVAffFunc::Eq, LoopCount);
buildAffineFunction(LoopCount, LoopBounds[L], Scop.getMaxRegion(),
Scop.getParamSet());
More information about the llvm-commits
mailing list