summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2019-08-31 03:17:49 +0000
committerWei Mi <wmi@google.com>2019-08-31 03:17:49 +0000
commit198009ae8db11d7c0b0517f17358870dc486fcfb (patch)
tree76b236db6f6d01ea1aaa92cfffa357b41b039ea8
parent798e59b81fb7a92cd5f3b1bb0761283f99adcd46 (diff)
downloadbcm5719-llvm-198009ae8db11d7c0b0517f17358870dc486fcfb.tar.gz
bcm5719-llvm-198009ae8db11d7c0b0517f17358870dc486fcfb.zip
Fix some errors introduced by rL370563 which were not exposed on my local machine.
1. zlib::compress accept &size_t but the param is an uint64_t. 2. Some systems don't have zlib installed. Don't use compression by default. llvm-svn: 370564
-rw-r--r--llvm/include/llvm/ProfileData/SampleProf.h2
-rw-r--r--llvm/lib/ProfileData/SampleProf.cpp3
-rw-r--r--llvm/tools/llvm-profdata/llvm-profdata.cpp2
3 files changed, 4 insertions, 3 deletions
diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h
index e5cc494b92c..157c79f6772 100644
--- a/llvm/include/llvm/ProfileData/SampleProf.h
+++ b/llvm/include/llvm/ProfileData/SampleProf.h
@@ -637,7 +637,7 @@ private:
// Determine whether or not to compress the symbol list when
// writing it into profile. The variable is unused when the symbol
// list is read from an existing profile.
- bool ToCompress = true;
+ bool ToCompress = false;
DenseSet<StringRef> Syms;
BumpPtrAllocator Allocator;
};
diff --git a/llvm/lib/ProfileData/SampleProf.cpp b/llvm/lib/ProfileData/SampleProf.cpp
index 36c39c12432..e94848df24e 100644
--- a/llvm/lib/ProfileData/SampleProf.cpp
+++ b/llvm/lib/ProfileData/SampleProf.cpp
@@ -211,7 +211,8 @@ std::error_code ProfileSymbolList::read(uint64_t CompressSize,
StringRef CompressedStrings(reinterpret_cast<const char *>(Data),
CompressSize);
char *Buffer = Allocator.Allocate<char>(UncompressSize);
- llvm::Error E = zlib::uncompress(CompressedStrings, Buffer, UncompressSize);
+ size_t UCSize = UncompressSize;
+ llvm::Error E = zlib::uncompress(CompressedStrings, Buffer, UCSize);
if (E)
return sampleprof_error::uncompress_failed;
ListStart = Buffer;
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index d3b7c2b2c80..a894d10c9c7 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -637,7 +637,7 @@ static int merge_main(int argc, const char *argv[]) {
cl::desc("Path to file containing the list of function symbols "
"used to populate profile symbol list"));
cl::opt<bool> CompressProfSymList(
- "compress-prof-sym-list", cl::init(true), cl::Hidden,
+ "compress-prof-sym-list", cl::init(false), cl::Hidden,
cl::desc("Compress profile symbol list before write it into profile. "));
cl::ParseCommandLineOptions(argc, argv, "LLVM profile data merger\n");
OpenPOWER on IntegriCloud