X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=include%2Fllvm%2FCodeGen%2FRegAllocPBQP.h;h=3d242f1bebe1549f0e80809fc7aef976e856041e;hp=2dca0e786dedad5f76c0fc4fb662c5d1ad12b403;hb=0846d688d142d204df228b5b3bdeea908355eda3;hpb=82256c40195f3c3b3fbf5f865b4b95ae578e1aa5 diff --git a/include/llvm/CodeGen/RegAllocPBQP.h b/include/llvm/CodeGen/RegAllocPBQP.h index 2dca0e786de..3d242f1bebe 100644 --- a/include/llvm/CodeGen/RegAllocPBQP.h +++ b/include/llvm/CodeGen/RegAllocPBQP.h @@ -62,15 +62,20 @@ public: delete[] ColCounts; } + ~MatrixMetadata() { + delete[] UnsafeRows; + delete[] UnsafeCols; + } + unsigned getWorstRow() const { return WorstRow; } unsigned getWorstCol() const { return WorstCol; } - const bool* getUnsafeRows() const { return UnsafeRows.get(); } - const bool* getUnsafeCols() const { return UnsafeCols.get(); } + const bool* getUnsafeRows() const { return UnsafeRows; } + const bool* getUnsafeCols() const { return UnsafeCols; } private: unsigned WorstRow, WorstCol; - std::unique_ptr UnsafeRows; - std::unique_ptr UnsafeCols; + bool* UnsafeRows; + bool* UnsafeCols; }; class NodeMetadata { @@ -83,6 +88,7 @@ public: NotProvablyAllocatable } ReductionState; NodeMetadata() : RS(Unprocessed), DeniedOpts(0), OptUnsafeEdges(nullptr){} + ~NodeMetadata() { delete[] OptUnsafeEdges; } void setVReg(unsigned VReg) { this->VReg = VReg; } unsigned getVReg() const { return VReg; } @@ -94,7 +100,7 @@ public: void setup(const Vector& Costs) { NumOpts = Costs.getLength() - 1; - OptUnsafeEdges = std::unique_ptr(new unsigned[NumOpts]()); + OptUnsafeEdges = new unsigned[NumOpts](); } ReductionState getReductionState() const { return RS; } @@ -118,15 +124,15 @@ public: bool isConservativelyAllocatable() const { return (DeniedOpts < NumOpts) || - (std::find(&OptUnsafeEdges[0], &OptUnsafeEdges[NumOpts], 0) != - &OptUnsafeEdges[NumOpts]); + (std::find(OptUnsafeEdges, OptUnsafeEdges + NumOpts, 0) != + OptUnsafeEdges + NumOpts); } private: ReductionState RS; unsigned NumOpts; unsigned DeniedOpts; - std::unique_ptr OptUnsafeEdges; + unsigned* OptUnsafeEdges; unsigned VReg; OptionToRegMap OptionRegs; };