//===----------------------------------------------------------------------===//
// TempScop implementation
TempScop::~TempScop() {
- if (MayASInfo) delete MayASInfo;
+ if (MayASInfo)
+ delete MayASInfo;
}
void TempScop::print(raw_ostream &OS, ScalarEvolution *SE, LoopInfo *LI) const {
- OS << "Scop: " << R.getNameStr() << ", Max Loop Depth: "<< MaxLoopDepth
- << "\n";
+ OS << "Scop: " << R.getNameStr() << ", Max Loop Depth: " << MaxLoopDepth
+ << "\n";
printDetail(OS, SE, LI, &R, 0);
}
const SCEV *AccessFunction = SE->getSCEV(getPointerOperand(Inst));
const SCEVUnknown *BasePointer =
- dyn_cast<SCEVUnknown>(SE->getPointerBase(AccessFunction));
+ dyn_cast<SCEVUnknown>(SE->getPointerBase(AccessFunction));
assert(BasePointer && "Could not find base pointer");
AccessFunction = SE->getMinusSCEV(AccessFunction, BasePointer);
- bool IsAffine = isAffineExpr(&R, AccessFunction, *SE,
- BasePointer->getValue());
+ bool IsAffine =
+ isAffineExpr(&R, AccessFunction, *SE, BasePointer->getValue());
- Functions.push_back(std::make_pair(IRAccess(Type,
- BasePointer->getValue(),
- AccessFunction, Size,
- IsAffine),
- &Inst));
+ Functions.push_back(
+ std::make_pair(IRAccess(Type, BasePointer->getValue(), AccessFunction,
+ Size, IsAffine), &Inst));
}
}
Region &R = Scop.getMaxRegion();
unsigned MaxLoopDepth = 0;
- for (Region::block_iterator I = R.block_begin(), E = R.block_end();
- I != E; ++I) {
+ for (Region::block_iterator I = R.block_begin(), E = R.block_end(); I != E;
+ ++I) {
Loop *L = LI->getLoopFor(*I);
if (!L || !R.contains(L))
TempScop *TempScopInfo::buildTempScop(Region &R) {
TempScop *TScop = new TempScop(R, LoopBounds, BBConds, AccFuncMap);
- for (Region::block_iterator I = R.block_begin(), E = R.block_end();
- I != E; ++I) {
+ for (Region::block_iterator I = R.block_begin(), E = R.block_end(); I != E;
+ ++I) {
buildAccessFunctions(R, **I);
buildCondition(*I, R.getEntry());
}
return at == TempScops.end() ? 0 : at->second;
}
-void TempScopInfo::print(raw_ostream &OS, const Module *) const {
+void TempScopInfo::print(raw_ostream &OS, const Module *)const {
for (TempScopMapType::const_iterator I = TempScops.begin(),
- E = TempScops.end(); I != E; ++I)
+ E = TempScops.end();
+ I != E; ++I)
I->second->print(OS, SE, LI);
}
TD = &getAnalysis<DataLayout>();
for (ScopDetection::iterator I = SD->begin(), E = SD->end(); I != E; ++I) {
- Region *R = const_cast<Region*>(*I);
+ Region *R = const_cast<Region *>(*I);
TempScops.insert(std::make_pair(R, buildTempScop(*R)));
}
AU.setPreservesAll();
}
-TempScopInfo::~TempScopInfo() {
- clear();
-}
+TempScopInfo::~TempScopInfo() { clear(); }
void TempScopInfo::clear() {
BBConds.clear();