From d70808f6bb7d93e821c6a25d7ca4367c993c9730 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Fri, 11 Dec 2015 20:23:22 +0000 Subject: [PATCH] [PGO] Revert r255365: solution incomplete, not handling lambda yet git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255369 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ProfileData/InstrProf.h | 2 +- lib/ProfileData/InstrProf.cpp | 9 ++++----- .../PGOProfile/Inputs/criticaledge.proftext | 2 +- test/Transforms/PGOProfile/criticaledge.ll | 4 ++-- .../tools/llvm-profdata/Inputs/compat.profdata.v4 | Bin 816 -> 0 bytes test/tools/llvm-profdata/compat.proftext | 7 ------- 6 files changed, 8 insertions(+), 16 deletions(-) delete mode 100644 test/tools/llvm-profdata/Inputs/compat.profdata.v4 diff --git a/include/llvm/ProfileData/InstrProf.h b/include/llvm/ProfileData/InstrProf.h index 577201542a9..2730cc167f7 100644 --- a/include/llvm/ProfileData/InstrProf.h +++ b/include/llvm/ProfileData/InstrProf.h @@ -30,7 +30,7 @@ #include #include -#define INSTR_PROF_INDEX_VERSION 4 +#define INSTR_PROF_INDEX_VERSION 3 namespace llvm { class Function; diff --git a/lib/ProfileData/InstrProf.cpp b/lib/ProfileData/InstrProf.cpp index 2608847fd10..a965a1208b5 100644 --- a/lib/ProfileData/InstrProf.cpp +++ b/lib/ProfileData/InstrProf.cpp @@ -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__"); - 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, ":"); else - FuncName = FuncName.insert(0, FileName.str() + Sep); + FuncName = FuncName.insert(0, FileName.str() + ":"); } return FuncName; } diff --git a/test/Transforms/PGOProfile/Inputs/criticaledge.proftext b/test/Transforms/PGOProfile/Inputs/criticaledge.proftext index eb5eb16c6cc..f369ba7c350 100644 --- a/test/Transforms/PGOProfile/Inputs/criticaledge.proftext +++ b/test/Transforms/PGOProfile/Inputs/criticaledge.proftext @@ -10,7 +10,7 @@ test_criticalEdge 2 1 -__bar +:bar 12884901887 1 7 diff --git a/test/Transforms/PGOProfile/criticaledge.ll b/test/Transforms/PGOProfile/criticaledge.ll index 7e0a7fd5220..7898f3b9eb1 100644 --- a/test/Transforms/PGOProfile/criticaledge.ll +++ b/test/Transforms/PGOProfile/criticaledge.ll @@ -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___bar" = private constant [12 x i8] c"__bar" +; GEN: @"__llvm_profile_name_:bar" = private constant [11 x i8] c":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___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_: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 index 1720c4072829ec87db96cab7ada73b6554c1d181..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 816 zcmeyLQ&5zjmf6U{00AP4*`X{5rN9WG85!;~XRPG*UH?)XDz5>hGxLf|ia>_wCCA67 z<>$v2mn4>CCUZfhnV>Yx;FkRm5e}$0Bg2}#61RO0{fJ?Piogs8nuTtN&U}dL_UuD9 z