[PATCH] D15547: [PGO] Handle and report overflow during profile merge for all types of data

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 09:23:00 PST 2015


On Wed, Dec 16, 2015 at 7:15 AM, Diego Novillo <dnovillo at google.com> wrote:
>
>
> On Tue, Dec 15, 2015 at 7:35 PM, David Li <davidxl at google.com> wrote:
>>
>> davidxl added inline comments.
>>
>> ================
>> Comment at: include/llvm/ProfileData/SampleProf.h:299
>> @@ +298,3 @@
>> +        addTotalSamples(Other.getTotalSamples(), Weight);
>> +    if (AddTotalSamplesResult != sampleprof_error::success)
>> +      Result = AddTotalSamplesResult;
>> ----------------
>> May be introducing a macro for the repeated patterns:
>>
>> #define SET_RESULT(R, FinalR) \
>>   if (R != ....) \
>>      FinalR = R;
>>
>
> No, please.  Not a macro.  An inline function.

I won't mind either way -- both are more readable.

David


More information about the llvm-commits mailing list