summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Analysis')
-rw-r--r--polly/lib/Analysis/Dependences.cpp7
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp23
-rw-r--r--polly/lib/Analysis/ScopGraphPrinter.cpp2
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp21
-rw-r--r--polly/lib/Analysis/TempScopInfo.cpp2
5 files changed, 23 insertions, 32 deletions
diff --git a/polly/lib/Analysis/Dependences.cpp b/polly/lib/Analysis/Dependences.cpp
index 16be7abe098..366822ad1af 100644
--- a/polly/lib/Analysis/Dependences.cpp
+++ b/polly/lib/Analysis/Dependences.cpp
@@ -53,9 +53,8 @@ Dependences::Dependences() : ScopPass(ID) {
RAW = WAR = WAW = NULL;
}
-void Dependences::collectInfo(Scop &S,
- isl_union_map **Read, isl_union_map **Write,
- isl_union_map **MayWrite,
+void Dependences::collectInfo(Scop &S, isl_union_map **Read,
+ isl_union_map **Write, isl_union_map **MayWrite,
isl_union_map **Schedule) {
isl_space *Space = S.getParamSpace();
*Read = isl_union_map_empty(isl_space_copy(Space));
@@ -268,7 +267,7 @@ void Dependences::releaseMemory() {
isl_union_map_free(WAR);
isl_union_map_free(WAW);
- RAW = WAR = WAW = NULL;
+ RAW = WAR = WAW = NULL;
}
isl_union_map *Dependences::getDependences(int Kinds) {
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index f4c3a9cffa1..b322152402a 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -153,8 +153,8 @@ std::string ScopDetection::regionIsInvalidBecause(const Region *R) const {
return InvalidRegions.find(R)->second;
}
-bool ScopDetection::isValidCFG(BasicBlock &BB, DetectionContext &Context) const
-{
+bool ScopDetection::isValidCFG(BasicBlock &BB,
+ DetectionContext &Context) const {
Region &RefRegion = Context.CurRegion;
TerminatorInst *TI = BB.getTerminator();
@@ -173,8 +173,7 @@ bool ScopDetection::isValidCFG(BasicBlock &BB, DetectionContext &Context) const
// UndefValue is not allowed as condition.
if (isa<UndefValue>(Condition))
- INVALID(AffFunc, "Condition based on 'undef' value in BB: "
- + BB.getName());
+ INVALID(AffFunc, "Condition based on 'undef' value in BB: " + BB.getName());
// Only Constant and ICmpInst are allowed as condition.
if (!(isa<Constant>(Condition) || isa<ICmpInst>(Condition)))
@@ -190,7 +189,7 @@ bool ScopDetection::isValidCFG(BasicBlock &BB, DetectionContext &Context) const
//
// TODO: This is not sufficient and just hides bugs. However it does pretty
// well.
- if(ICmp->isUnsigned())
+ if (ICmp->isUnsigned())
return false;
// Are both operands of the ICmp affine?
@@ -256,7 +255,8 @@ bool ScopDetection::isValidMemoryAccess(Instruction &Inst,
AccessFunction = SE->getMinusSCEV(AccessFunction, BasePointer);
- if (!isAffineExpr(&Context.CurRegion, AccessFunction, *SE, BaseValue) && !AllowNonAffine)
+ if (!isAffineExpr(&Context.CurRegion, AccessFunction, *SE, BaseValue) &&
+ !AllowNonAffine)
INVALID(AffFunc, "Non affine access function: " << *AccessFunction);
// FIXME: Alias Analysis thinks IntToPtrInst aliases with alloca instructions
@@ -285,7 +285,6 @@ bool ScopDetection::isValidMemoryAccess(Instruction &Inst,
return true;
}
-
bool ScopDetection::hasScalarDependency(Instruction &Inst,
Region &RefRegion) const {
for (Instruction::use_iterator UI = Inst.use_begin(), UE = Inst.use_end();
@@ -380,7 +379,7 @@ bool ScopDetection::isValidLoop(Loop *L, DetectionContext &Context) const {
Region *ScopDetection::expandRegion(Region &R) {
// Initial no valid region was found (greater than R)
Region *LastValidRegion = NULL;
- Region *ExpandedRegion = R.getExpandedRegion();
+ Region *ExpandedRegion = R.getExpandedRegion();
DEBUG(dbgs() << "\tExpanding " << R.getNameStr() << "\n");
@@ -427,7 +426,6 @@ Region *ScopDetection::expandRegion(Region &R) {
return LastValidRegion;
}
-
void ScopDetection::findScops(Region &R) {
DetectionContext Context(R, *AA, false /*verifying*/);
@@ -496,7 +494,7 @@ bool ScopDetection::isValidExit(DetectionContext &Context) const {
// PHI nodes are not allowed in the exit basic block.
if (BasicBlock *Exit = R.getExit()) {
BasicBlock::iterator I = Exit->begin();
- if (I != Exit->end() && isa<PHINode> (*I))
+ if (I != Exit->end() && isa<PHINode>(*I))
INVALID(Other, "PHI node in exit BB");
}
@@ -561,7 +559,7 @@ void ScopDetection::getDebugLocation(const Region *R, unsigned &LineBegin,
LineBegin = std::min(LineBegin, NewLine);
LineEnd = std::max(LineEnd, NewLine);
break;
- }
+ }
}
void ScopDetection::printLocations() {
@@ -594,7 +592,7 @@ bool ScopDetection::runOnFunction(llvm::Function &F) {
if (OnlyFunction != "" && F.getName() != OnlyFunction)
return false;
- if(!isValidFunction(F))
+ if (!isValidFunction(F))
return false;
findScops(*TopRegion);
@@ -605,7 +603,6 @@ bool ScopDetection::runOnFunction(llvm::Function &F) {
return false;
}
-
void polly::ScopDetection::verifyRegion(const Region &R) const {
assert(isMaxRegionInScop(R) && "Expect R is a valid region.");
DetectionContext Context(const_cast<Region&>(R), *AA, true /*verifying*/);
diff --git a/polly/lib/Analysis/ScopGraphPrinter.cpp b/polly/lib/Analysis/ScopGraphPrinter.cpp
index 02308dfa43a..6c2a7372376 100644
--- a/polly/lib/Analysis/ScopGraphPrinter.cpp
+++ b/polly/lib/Analysis/ScopGraphPrinter.cpp
@@ -166,7 +166,7 @@ struct DOTGraphTraits<ScopDetection*> : public DOTGraphTraits<RegionNode*> {
}
};
-} //end namespace llvm
+} //end namespace llvm
struct ScopViewer
: public DOTGraphTraitsViewer<ScopDetection, false> {
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index f0827b3acd7..b8772dbe52e 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -230,17 +230,16 @@ MemoryAccess::~MemoryAccess() {
isl_map_free(newAccessRelation);
}
-static void replace(std::string& str, const std::string& find,
- const std::string& replace) {
+static void replace(std::string &str, const std::string &find,
+ const std::string &replace) {
size_t pos = 0;
- while((pos = str.find(find, pos)) != std::string::npos)
- {
+ while ((pos = str.find(find, pos)) != std::string::npos) {
str.replace(pos, find.length(), replace);
pos += replace.length();
}
}
-static void makeIslCompatible(std::string& str) {
+static void makeIslCompatible(std::string &str) {
str.erase(0, 1);
replace(str, ".", "_");
replace(str, "\"", "_");
@@ -691,7 +690,7 @@ void ScopStmt::print(raw_ostream &OS) const {
OS.indent(16) << "n/a\n";
for (MemoryAccessVec::const_iterator I = MemAccs.begin(), E = MemAccs.end();
- I != E; ++I)
+ I != E; ++I)
(*I)->print(OS);
}
@@ -742,7 +741,7 @@ __isl_give isl_id *Scop::getIdForParam(const SCEV *Parameter) const {
void Scop::buildContext() {
isl_space *Space = isl_space_params_alloc(IslCtx, 0);
- Context = isl_set_universe (Space);
+ Context = isl_set_universe(Space);
}
void Scop::addParameterBounds() {
@@ -776,7 +775,6 @@ void Scop::addParameterBounds() {
}
}
-
void Scop::realignParams() {
// Add all parameters into a common model.
isl_space *Space = isl_space_params_alloc(IslCtx, ParameterIds.size());
@@ -826,7 +824,7 @@ Scop::~Scop() {
}
std::string Scop::getContextStr() const {
- return stringFromIslObj(Context);
+ return stringFromIslObj(Context);
}
std::string Scop::getNameStr() const {
@@ -875,13 +873,12 @@ void Scop::printContext(raw_ostream &OS) const {
void Scop::printStatements(raw_ostream &OS) const {
OS << "Statements {\n";
- for (const_iterator SI = begin(), SE = end();SI != SE; ++SI)
+ for (const_iterator SI = begin(), SE = end(); SI != SE; ++SI)
OS.indent(4) << (**SI);
OS.indent(4) << "}\n";
}
-
void Scop::print(raw_ostream &OS) const {
printContext(OS.indent(4));
printStatements(OS.indent(4));
@@ -964,8 +961,6 @@ ScopInfo::~ScopInfo() {
isl_ctx_free(ctx);
}
-
-
void ScopInfo::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<LoopInfo>();
AU.addRequired<RegionInfo>();
diff --git a/polly/lib/Analysis/TempScopInfo.cpp b/polly/lib/Analysis/TempScopInfo.cpp
index 1d64db7bdad..ac07b738a25 100644
--- a/polly/lib/Analysis/TempScopInfo.cpp
+++ b/polly/lib/Analysis/TempScopInfo.cpp
@@ -146,7 +146,7 @@ void TempScopInfo::buildLoopBounds(TempScop &Scop) {
}
void TempScopInfo::buildAffineCondition(Value &V, bool inverted,
- Comparison **Comp) const {
+ Comparison **Comp) const {
if (ConstantInt *C = dyn_cast<ConstantInt>(&V)) {
// If this is always true condition, we will create 1 >= 0,
// otherwise we will create 1 == 0.
OpenPOWER on IntegriCloud