From 8cb2706af62db6625ec8c0f61ba3a93e1f2f442f Mon Sep 17 00:00:00 2001 From: Dylan Noblesmith Date: Tue, 26 Aug 2014 02:03:38 +0000 Subject: [PATCH] Revert "Analysis: unique_ptr-ify DependenceAnalysis::collectCoeffInfo" This reverts commit r216358. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216431 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/DependenceAnalysis.h | 7 +++---- lib/Analysis/DependenceAnalysis.cpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/include/llvm/Analysis/DependenceAnalysis.h b/include/llvm/Analysis/DependenceAnalysis.h index d032a418366..a52d6a8ef2d 100644 --- a/include/llvm/Analysis/DependenceAnalysis.h +++ b/include/llvm/Analysis/DependenceAnalysis.h @@ -766,10 +766,9 @@ namespace llvm { /// collectCoefficientInfo - Walks through the subscript, /// collecting each coefficient, the associated loop bounds, /// and recording its positive and negative parts for later use. - std::unique_ptr - collectCoeffInfo(const SCEV *Subscript, - bool SrcFlag, - const SCEV *&Constant) const; + CoefficientInfo *collectCoeffInfo(const SCEV *Subscript, + bool SrcFlag, + const SCEV *&Constant) const; /// getPositivePart - X^+ = max(X, 0). /// diff --git a/lib/Analysis/DependenceAnalysis.cpp b/lib/Analysis/DependenceAnalysis.cpp index 8120736885c..be4e487a149 100644 --- a/lib/Analysis/DependenceAnalysis.cpp +++ b/lib/Analysis/DependenceAnalysis.cpp @@ -2437,14 +2437,11 @@ bool DependenceAnalysis::banerjeeMIVtest(const SCEV *Src, ++BanerjeeApplications; DEBUG(dbgs() << " Src = " << *Src << '\n'); const SCEV *A0; - auto AOwner = collectCoeffInfo(Src, true, A0); - auto A = AOwner.get(); + CoefficientInfo *A = collectCoeffInfo(Src, true, A0); DEBUG(dbgs() << " Dst = " << *Dst << '\n'); const SCEV *B0; - auto BOwner = collectCoeffInfo(Dst, false, B0); - auto B = BOwner.get(); - auto BoundOwner = make_unique(MaxLevels + 1); - auto Bound = BoundOwner.get(); + CoefficientInfo *B = collectCoeffInfo(Dst, false, B0); + BoundInfo *Bound = new BoundInfo[MaxLevels + 1]; const SCEV *Delta = SE->getMinusSCEV(B0, A0); DEBUG(dbgs() << "\tDelta = " << *Delta << '\n'); @@ -2501,6 +2498,9 @@ bool DependenceAnalysis::banerjeeMIVtest(const SCEV *Src, ++BanerjeeIndependence; Disproved = true; } + delete [] Bound; + delete [] A; + delete [] B; return Disproved; } @@ -2818,12 +2818,12 @@ const SCEV *DependenceAnalysis::getNegativePart(const SCEV *X) const { // Walks through the subscript, // collecting each coefficient, the associated loop bounds, // and recording its positive and negative parts for later use. -std::unique_ptr +DependenceAnalysis::CoefficientInfo * DependenceAnalysis::collectCoeffInfo(const SCEV *Subscript, bool SrcFlag, const SCEV *&Constant) const { const SCEV *Zero = SE->getConstant(Subscript->getType(), 0); - auto CI = make_unique(MaxLevels + 1); + CoefficientInfo *CI = new CoefficientInfo[MaxLevels + 1]; for (unsigned K = 1; K <= MaxLevels; ++K) { CI[K].Coeff = Zero; CI[K].PosPart = Zero; -- 2.34.1