HomePhabricator

[InstrProf][NFC] Do not assume size of counter type

Authored by ellis on Wed, Dec 29, 1:36 PM.

Description

[InstrProf][NFC] Do not assume size of counter type

Existing code tended to assume that counters had type uint64_t and
computed size from the number of counters. Fix this code to directly
compute the counters size in number of bytes where possible. When the
number of counters is needed, use __llvm_profile_counter_entry_size()
or getCounterTypeSize(). In a later diff these functions will depend
on the profile mode.

Change the meaning of DataSize and CountersSize to make them more clear.

  • DataSize (CountersSize) - the size of the data (counter) section in bytes.
  • NumData (NumCounters) - the number of data (counter) entries.

Reviewed By: kyulee

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

Details

Committed
ellisFri, Jan 14, 11:29 AM
Reviewer
kyulee
Differential Revision
D116179: [InstrProf][NFC] Do not assume size of counter type
Parents
rGacb8de565eaa: [JumpThreading] Change asserts for WantInteger into actual checks
Branches
Unknown
Tags
Unknown