Skip to content

Commit

Permalink
[Profile] Removed incorrect check introduced by cf2cf19.
Browse files Browse the repository at this point in the history
There may be some padding before or after counters.
  • Loading branch information
ZequanWu committed Aug 14, 2023
1 parent c70dab0 commit bfc965c
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions compiler-rt/lib/profile/InstrProfilingMerge.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,10 @@ int __llvm_profile_check_compatibility(const char *ProfileData,
uint64_t ProfileSize) {
__llvm_profile_header *Header = (__llvm_profile_header *)ProfileData;
__llvm_profile_data *SrcDataStart, *SrcDataEnd, *SrcData, *DstData;
char *SrcCountersStart, *SrcCountersEnd;
SrcDataStart =
(__llvm_profile_data *)(ProfileData + sizeof(__llvm_profile_header) +
Header->BinaryIdsSize);
SrcDataEnd = SrcDataStart + Header->DataSize;
SrcCountersStart = (char *)SrcDataEnd;
SrcCountersEnd = SrcCountersStart +
Header->CountersSize * __llvm_profile_counter_entry_size();

if (ProfileSize < sizeof(__llvm_profile_header))
return 1;
Expand All @@ -75,11 +71,6 @@ int __llvm_profile_check_compatibility(const char *ProfileData,
Header->ValueKindLast != IPVK_Last)
return 1;

if (SrcCountersEnd - SrcCountersStart !=
__llvm_profile_end_counters() - __llvm_profile_begin_counters()) {
return 1;
}

if (ProfileSize <
sizeof(__llvm_profile_header) + Header->BinaryIdsSize +
Header->DataSize * sizeof(__llvm_profile_data) + Header->NamesSize +
Expand Down

0 comments on commit bfc965c

Please sign in to comment.