Minor refactor to make VP writing more efficient
[oota-llvm.git] / lib / ProfileData / InstrProf.cpp
index fc7fc8aa1e25dd4e621048d183c9a97daa324c93..b670902f3f9f5ca824c413af3abab09a629fbed8 100644 (file)
@@ -166,10 +166,8 @@ void ValueProfRecord::serializeFrom(const InstrProfRecord &Record,
   for (uint32_t S = 0; S < NumValueSites; S++) {
     uint32_t ND = Record.getNumValueDataForSite(ValueKind, S);
     SiteCountArray[S] = ND;
-    std::unique_ptr<InstrProfValueData[]> SrcVD =
-        Record.getValueForSite(ValueKind, S);
+    Record.getValueForSite(DstVD, ValueKind, S);
     for (uint32_t I = 0; I < ND; I++) {
-      DstVD[I] = SrcVD[I];
       switch (ValueKind) {
       case IPVK_IndirectCallTarget:
         DstVD[I].Value = IndexedInstrProf::ComputeHash(