Revert "[llvm-profdata] Add support for weighted merge of profile data"
[oota-llvm.git] / lib / ProfileData / InstrProfWriter.cpp
index 2261c92f03a93146c04e056151643af24ed9633c..78bec012eeb24d08511f1f0da99161a69cfa145f 100644 (file)
@@ -98,8 +98,7 @@ void InstrProfWriter::updateStringTableReferences(InstrProfRecord &I) {
   I.updateStrings(&StringTable);
 }
 
-std::error_code InstrProfWriter::addRecord(InstrProfRecord &&I,
-                                           uint64_t Weight) {
+std::error_code InstrProfWriter::addRecord(InstrProfRecord &&I) {
   updateStringTableReferences(I);
   auto &ProfileDataMap = FunctionData[I.Name];
 
@@ -114,18 +113,9 @@ std::error_code InstrProfWriter::addRecord(InstrProfRecord &&I,
     // We've never seen a function with this name and hash, add it.
     Dest = std::move(I);
     Result = instrprof_error::success;
-    if (Weight > 1) {
-      for (auto &Count : Dest.Counts) {
-        bool Overflowed;
-        Count = SaturatingMultiply(Count, Weight, Overflowed);
-        if (Overflowed && Result == instrprof_error::success) {
-          Result = instrprof_error::counter_overflow;
-        }
-      }
-    }
   } else {
     // We're updating a function we've seen before.
-    Result = Dest.merge(I, Weight);
+    Result = Dest.merge(I);
   }
 
   // We keep track of the max function count as we go for simplicity.