[PGO] Revert r255365: solution incomplete, not handling lambda yet
authorXinliang David Li <davidxl@google.com>
Fri, 11 Dec 2015 20:23:22 +0000 (20:23 +0000)
committerXinliang David Li <davidxl@google.com>
Fri, 11 Dec 2015 20:23:22 +0000 (20:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255369 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ProfileData/InstrProf.h
lib/ProfileData/InstrProf.cpp
test/Transforms/PGOProfile/Inputs/criticaledge.proftext
test/Transforms/PGOProfile/criticaledge.ll
test/tools/llvm-profdata/Inputs/compat.profdata.v4 [deleted file]
test/tools/llvm-profdata/compat.proftext

index 577201542a9a83800c817df085b3fa937e802a02..2730cc167f7dfa248dd077d2a3251d2e6a3e8d8a 100644 (file)
@@ -30,7 +30,7 @@
 #include <system_error>
 #include <vector>
 
-#define INSTR_PROF_INDEX_VERSION 4
+#define INSTR_PROF_INDEX_VERSION 3
 namespace llvm {
 
 class Function;
index 2608847fd103f0e4ae1d65238e92b6993e3ae108..a965a1208b51a059f4fa20638a15bb0a661c9d75 100644 (file)
@@ -74,15 +74,14 @@ namespace llvm {
 
 std::string getPGOFuncName(StringRef RawFuncName,
                            GlobalValue::LinkageTypes Linkage,
-                           StringRef FileName, uint64_t Version) {
+                           StringRef FileName,
+                           uint64_t Version LLVM_ATTRIBUTE_UNUSED) {
 
   // Function names may be prefixed with a binary '1' to indicate
   // that the backend should not modify the symbols due to any platform
   // naming convention. Do not include that '1' in the PGO profile name.
   if (RawFuncName[0] == '\1')
     RawFuncName = RawFuncName.substr(1);
-  const char *Unknown = (Version <= 3 ? "<unknown>:" : "__unknown__");
-  const char *Sep = (Version <= 3 ? ":" : "__");
 
   std::string FuncName = RawFuncName;
   if (llvm::GlobalValue::isLocalLinkage(Linkage)) {
@@ -91,9 +90,9 @@ std::string getPGOFuncName(StringRef RawFuncName,
     // that it will stay the same, e.g., if the files are checked out from
     // version control in different locations.
     if (FileName.empty())
-      FuncName = FuncName.insert(0, Unknown);
+      FuncName = FuncName.insert(0, "<unknown>:");
     else
-      FuncName = FuncName.insert(0, FileName.str() + Sep);
+      FuncName = FuncName.insert(0, FileName.str() + ":");
   }
   return FuncName;
 }
index eb5eb16c6cce0575bc0ccba42cc77b05fe2cf006..f369ba7c350420ee6c8a1b1327be240520010af3 100644 (file)
@@ -10,7 +10,7 @@ test_criticalEdge
 2
 1
 
-<stdin>__bar
+<stdin>:bar
 12884901887
 1
 7
index 7e0a7fd5220880f89e871733823df6d0d476e30a..7898f3b9eb1b961c443a6d1d6247496539e5a61b 100644 (file)
@@ -5,7 +5,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 ; GEN: @__llvm_profile_name_test_criticalEdge = private constant [17 x i8] c"test_criticalEdge"
-; GEN: @"__llvm_profile_name_<stdin>__bar" = private constant [12 x i8] c"<stdin>__bar"
+; GEN: @"__llvm_profile_name_<stdin>:bar" = private constant [11 x i8] c"<stdin>:bar"
 
 define i32 @test_criticalEdge(i32 %i, i32 %j) {
 entry:
@@ -99,7 +99,7 @@ return:
 
 define internal i32 @bar(i32 %i) {
 entry:
-; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @"__llvm_profile_name_<stdin>__bar", i32 0, i32 0), i64 12884901887, i32 1, i32 0)
+; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"__llvm_profile_name_<stdin>:bar", i32 0, i32 0), i64 12884901887, i32 1, i32 0)
   ret i32 %i
 }
 
diff --git a/test/tools/llvm-profdata/Inputs/compat.profdata.v4 b/test/tools/llvm-profdata/Inputs/compat.profdata.v4
deleted file mode 100644 (file)
index 1720c40..0000000
Binary files a/test/tools/llvm-profdata/Inputs/compat.profdata.v4 and /dev/null differ
index 5bc6c9a736990866afcdaed9b40427fbcefd519c..139202d162e6f06741cc3204d701b38e9dd02cd8 100644 (file)
@@ -65,10 +65,3 @@ large_numbers
 # FORMATV2-NEXT: Maximum internal block count: 1000000
 
 
-# RUN: llvm-profdata show %S/Inputs/compat.profdata.v4 -all-functions --counts | FileCheck %s -check-prefix=FORMATV4
-# FORMATV4:  instrprof.c__foo_static:
-# FORMATV4-NEXT:    Hash: 0x000000000000000a
-# FORMATV4-NEXT:    Counters: 2
-# FORMATV4-NEXT:    Function count: 500500
-# FORMATV4-NEXT:    Block counts: [180100]
-