Since total sample and body sample are used to compute hotness threshold in compiler, we found in some services changing the total samples computation will cause noticeable regression. Hence, here we will revert the changes and just keep all total samples number identical to the old tool.
Three changes in this diff:
- Revert previous diff(https://reviews.llvm.org/D112672: [llvm-profgen] Update total samples by accumulating all its body samples) and put it under a switch.
- Keep the negative line number. Although compiler doesn't consume the count but it will be used to compute hot threshold.
- Change to accumulate total samples per byte instead of per instruction.
This doesn't really makes sense. Wondering how much it matters, compared to other places that affect total samples.