[llvm] r216431 - Revert "Analysis: unique_ptr-ify DependenceAnalysis::collectCoeffInfo"

Dylan Noblesmith nobled at dreamwidth.org
Mon Aug 25 19:03:38 PDT 2014


Author: nobled
Date: Mon Aug 25 21:03:38 2014
New Revision: 216431

URL: http://llvm.org/viewvc/llvm-project?rev=216431&view=rev
Log:
Revert "Analysis: unique_ptr-ify DependenceAnalysis::collectCoeffInfo"

This reverts commit r216358.

Modified:
    llvm/trunk/include/llvm/Analysis/DependenceAnalysis.h
    llvm/trunk/lib/Analysis/DependenceAnalysis.cpp

Modified: llvm/trunk/include/llvm/Analysis/DependenceAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DependenceAnalysis.h?rev=216431&r1=216430&r2=216431&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DependenceAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/DependenceAnalysis.h Mon Aug 25 21:03:38 2014
@@ -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<CoefficientInfo[]>
-    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).
     ///

Modified: llvm/trunk/lib/Analysis/DependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DependenceAnalysis.cpp?rev=216431&r1=216430&r2=216431&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/DependenceAnalysis.cpp Mon Aug 25 21:03:38 2014
@@ -2437,14 +2437,11 @@ bool DependenceAnalysis::banerjeeMIVtest
   ++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<BoundInfo[]>(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
     ++BanerjeeIndependence;
     Disproved = true;
   }
+  delete [] Bound;
+  delete [] A;
+  delete [] B;
   return Disproved;
 }
 
@@ -2818,12 +2818,12 @@ const SCEV *DependenceAnalysis::getNegat
 // 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::CoefficientInfo *
 DependenceAnalysis::collectCoeffInfo(const SCEV *Subscript,
                                      bool SrcFlag,
                                      const SCEV *&Constant) const {
   const SCEV *Zero = SE->getConstant(Subscript->getType(), 0);
-  auto CI = make_unique<CoefficientInfo[]>(MaxLevels + 1);
+  CoefficientInfo *CI = new CoefficientInfo[MaxLevels + 1];
   for (unsigned K = 1; K <= MaxLevels; ++K) {
     CI[K].Coeff = Zero;
     CI[K].PosPart = Zero;





More information about the llvm-commits mailing list