diff options
-rw-r--r-- | polly/include/polly/TempScopInfo.h | 2 | ||||
-rw-r--r-- | polly/lib/Analysis/TempScopInfo.cpp | 15 |
2 files changed, 6 insertions, 11 deletions
diff --git a/polly/include/polly/TempScopInfo.h b/polly/include/polly/TempScopInfo.h index ee65f564f3c..829a5c869c8 100644 --- a/polly/include/polly/TempScopInfo.h +++ b/polly/include/polly/TempScopInfo.h @@ -243,7 +243,7 @@ class TempScopInfo : public FunctionPass { void buildCondition(BasicBlock *BB, Region &R); // Build the affine function of the given condition - void buildAffineCondition(Value &V, bool inverted, Comparison **Comp) const; + Comparison buildAffineCondition(Value &V, bool inverted); // Return the temporary Scop information of Region R, where R must be a valid // part of Scop diff --git a/polly/lib/Analysis/TempScopInfo.cpp b/polly/lib/Analysis/TempScopInfo.cpp index d11f2ffe482..21a2c48a0f3 100644 --- a/polly/lib/Analysis/TempScopInfo.cpp +++ b/polly/lib/Analysis/TempScopInfo.cpp @@ -314,8 +314,7 @@ void TempScopInfo::buildAccessFunctions(Region &R, BasicBlock &BB, Accs.insert(Accs.end(), Functions.begin(), Functions.end()); } -void TempScopInfo::buildAffineCondition(Value &V, bool inverted, - Comparison **Comp) const { +Comparison TempScopInfo::buildAffineCondition(Value &V, bool inverted) { if (ConstantInt *C = dyn_cast<ConstantInt>(&V)) { // If this is always true condition, we will create 0 <= 1, // otherwise we will create 0 >= 1. @@ -323,11 +322,9 @@ void TempScopInfo::buildAffineCondition(Value &V, bool inverted, const SCEV *RHS = SE->getConstant(C->getType(), 1); if (C->isOne() == inverted) - *Comp = new Comparison(LHS, RHS, ICmpInst::ICMP_SLE); + return Comparison(LHS, RHS, ICmpInst::ICMP_SLE); else - *Comp = new Comparison(LHS, RHS, ICmpInst::ICMP_SGE); - - return; + return Comparison(LHS, RHS, ICmpInst::ICMP_SGE); } ICmpInst *ICmp = dyn_cast<ICmpInst>(&V); @@ -357,7 +354,7 @@ void TempScopInfo::buildAffineCondition(Value &V, bool inverted, break; } - *Comp = new Comparison(LHS, RHS, Pred); + return Comparison(LHS, RHS, Pred); } void TempScopInfo::buildCondition(BasicBlock *BB, Region &R) { @@ -421,9 +418,7 @@ void TempScopInfo::buildCondition(BasicBlock *BB, Region &R) { inverted = false; } - Comparison *Cmp; - buildAffineCondition(*(Br->getCondition()), inverted, &Cmp); - Cond.push_back(*Cmp); + Cond.push_back(buildAffineCondition(*(Br->getCondition()), inverted)); } if (!Cond.empty()) |