This change adds MathExtras helper functions for handling unsigned, saturating addition and multiplication. It also updates the instrumentation and sample profile merge implementations to use them.
No functional changes.
Differential D14720
[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions slingn on Nov 16 2015, 11:41 AM. Authored by
Details
This change adds MathExtras helper functions for handling unsigned, saturating addition and multiplication. It also updates the instrumentation and sample profile merge implementations to use them. No functional changes.
Diff Detail
Event TimelineComment Actions Related question: Is it by design that intstr profile count overflow is treated differently from sample profile count overflow? Comment Actions The way InstrProf handles overflow is a little extreme (by skipping the David Comment Actions Sample PGO will warn when the weights read from the profile saturate 32-bit values. Showing a warning in llvm-profdata when adding 64 bit values sounds like a good idea. |