[llvm-profdata] Remove unnecessary file size check
authorWilliam Huang <williamjhuang@google.com>
Wed, 28 Dec 2022 21:26:16 +0000 (21:26 +0000)
committerWilliam Huang <williamjhuang@google.com>
Tue, 3 Jan 2023 19:24:45 +0000 (19:24 +0000)
Unsure why profile reader checks profile size to be less than 4 GB. This breaks builds using a very large profile.
The limit is not seen anywhere else, so I am not sure why is it there in the first place.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D140741

llvm/lib/ProfileData/SampleProfReader.cpp

index 25b13e0..b2a38c6 100644 (file)
@@ -1837,10 +1837,6 @@ setupMemoryBuffer(const Twine &Filename) {
     return EC;
   auto Buffer = std::move(BufferOrErr.get());
 
-  // Check the file.
-  if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits<uint32_t>::max())
-    return sampleprof_error::too_large;
-
   return std::move(Buffer);
 }