[PATCH] D14547: [llvm-profdata] Add support for weighted merge of profile data

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 14:44:42 PST 2015


On Tue, Nov 10, 2015 at 2:36 PM, Diego Novillo <dnovillo at google.com> wrote:

>
>
> On Tue, Nov 10, 2015 at 3:07 PM, David Li <davidxl at google.com> wrote:
>
>>
>> ================
>> Comment at: test/tools/llvm-profdata/weight-sample.test:42
>> @@ +41,3 @@
>> +3- Bad merge: foo and bar profiles with too few weight values
>> +RUN: not llvm-profdata merge --sample --text -weights=2
>> %p/Inputs/weight-sample-bar.proftext %p/Inputs/weight-sample-foo.proftext
>> -o %t.out 2>&1 | FileCheck %s --check-prefix=ERROR1
>> +ERROR1: error: Profile weight must be specified for each input file.
>> ----------------
>> No need for such tests if the weight is always attached to the input file.
>>
>
> But then what happens if one of the files is specified without ":WEIGHT"?
> Should we complain about it?  Should we assume MAX(other weights)?
>

The default is 1 of course.


>
> I'm not sure I'm completely convinced that file1:W1 file2:W2 is better
> than --weights=W1,W2.  What if ':' is part of the filename?  I know, seems
> like a stretch.  I'm not actually arguing against it.  I mostly find it a
> bit odd.
>

: is just a suggestion, you can use coma to separate it.


pros:

1) the weight and file name are always 'together'. Think about a long list
of files -- having a separate list option make it harder to associate and
and  can not really skip the default weight of 1, e.g
-W10,1,1,1,1,1,1,1,1,1,20
2) there is no need for an additional option
3) the implementation is simpler and requires fewer code.

cons:
I don't see any real cons -- except that you find it weird -- but why?

David


>
>
> Diego.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151110/58fcf942/attachment.html>


More information about the llvm-commits mailing list