Surface counter overflow when merging profile data. Merging still occurs on overflow but counts saturate to the maximum representable value. Overflow is reported to the user.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/llvm/ProfileData/SampleProf.h | ||
---|---|---|
299 ↗ | (On Diff #42937) | May be introducing a macro for the repeated patterns: #define SET_RESULT(R, FinalR) \ if (R != ....) \ FinalR = R; |
Comment Actions
Updated for davidxl, dnovillo feedback.
include/llvm/ProfileData/SampleProf.h | ||
---|---|---|
299 ↗ | (On Diff #42937) | Went with inline function implementation as discussed on llvm-commits. |
include/llvm/ProfileData/InstrProf.h | ||
---|---|---|
187 ↗ | (On Diff #43029) | Nit: how about UpdateResult -- it seems a better name. |
include/llvm/ProfileData/SampleProf.h | ||
145 ↗ | (On Diff #43029) | There are also lots of if(..) return patterns that can be simplified. This case you will need a macro: #define RETURN_IF(Cond, Err) \ if(Cond) \ return Err; |