aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ProfileData/InstrProfTest.cpp
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-02-04 05:29:51 +0000
committerXinliang David Li <davidxl@google.com>2016-02-04 05:29:51 +0000
commit1e4c809c6c56fe41c68c60b7b3a4ac78663e5242 (patch)
treebf04254ec87dd80bb9e05b46c954139337666a48 /llvm/unittests/ProfileData/InstrProfTest.cpp
parent4199f3df29e50353bfa55bb410210d416b93f834 (diff)
downloadllvm-1e4c809c6c56fe41c68c60b7b3a4ac78663e5242.zip
llvm-1e4c809c6c56fe41c68c60b7b3a4ac78663e5242.tar.gz
llvm-1e4c809c6c56fe41c68c60b7b3a4ac78663e5242.tar.bz2
[PGO] Profile interface cleanup
- Remove unused valuemapper parameter - add totalcount optional parameter llvm-svn: 259756
Diffstat (limited to 'llvm/unittests/ProfileData/InstrProfTest.cpp')
-rw-r--r--llvm/unittests/ProfileData/InstrProfTest.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp
index 01e3ddd..be3ed42 100644
--- a/llvm/unittests/ProfileData/InstrProfTest.cpp
+++ b/llvm/unittests/ProfileData/InstrProfTest.cpp
@@ -211,12 +211,14 @@ TEST_P(MaybeSparseInstrProfTest, get_icall_data_read_write) {
ASSERT_EQ(2U, R.get().getNumValueDataForSite(IPVK_IndirectCallTarget, 2));
ASSERT_EQ(1U, R.get().getNumValueDataForSite(IPVK_IndirectCallTarget, 3));
+ uint64_t TotalC;
std::unique_ptr<InstrProfValueData[]> VD =
- R.get().getValueForSite(IPVK_IndirectCallTarget, 0);
+ R.get().getValueForSite(IPVK_IndirectCallTarget, 0, &TotalC);
ASSERT_EQ(3U, VD[0].Count);
ASSERT_EQ(2U, VD[1].Count);
ASSERT_EQ(1U, VD[2].Count);
+ ASSERT_EQ(6U, TotalC);
ASSERT_EQ(StringRef((const char *)VD[0].Value, 7), StringRef("callee3"));
ASSERT_EQ(StringRef((const char *)VD[1].Value, 7), StringRef("callee2"));
@@ -258,11 +260,13 @@ TEST_P(MaybeSparseInstrProfTest, get_icall_data_read_write_with_weight) {
ASSERT_EQ(2U, R.get().getNumValueDataForSite(IPVK_IndirectCallTarget, 2));
ASSERT_EQ(1U, R.get().getNumValueDataForSite(IPVK_IndirectCallTarget, 3));
+ uint64_t TotalC;
std::unique_ptr<InstrProfValueData[]> VD =
- R.get().getValueForSite(IPVK_IndirectCallTarget, 0);
+ R.get().getValueForSite(IPVK_IndirectCallTarget, 0, &TotalC);
ASSERT_EQ(30U, VD[0].Count);
ASSERT_EQ(20U, VD[1].Count);
ASSERT_EQ(10U, VD[2].Count);
+ ASSERT_EQ(60U, TotalC);
ASSERT_EQ(StringRef((const char *)VD[0].Value, 7), StringRef("callee3"));
ASSERT_EQ(StringRef((const char *)VD[1].Value, 7), StringRef("callee2"));