[PATCH] Add function entry count metadata.

Philip Reames listmail at philipreames.com
Tue May 12 15:33:14 PDT 2015


Before going any further discussing this, I'd like to see an example or 
LangRef documentation with an example.  I'm not even sure I read the 
code right and don't want to waste time discussing something which might 
be a result of a misread.

On 05/12/2015 02:59 PM, Diego Novillo wrote:
> On Tue, May 12, 2015 at 5:53 PM, Philip Reames
> <listmail at philipreames.com> wrote:
>> Reading through the code, I was a left a bit confused as to the actual structure.  Could you update with the LangRef update so that it's easier to review?  Also, tests for correct usage would be helpful.
> I've added tests for the Verifier in the latest update and also
> bytecode tests. What other tests are you thinking of?
>
> Thanks for the LangRef reminder. I had forgotten about that.
>
>> ================
>> Comment at: lib/IR/Function.cpp:995
>> @@ +994,3 @@
>> +  MDBuilder MDB(getContext());
>> +  setMetadata(LLVMContext::MD_prof, MDB.createFunctionEntryCount(Count));
>> +}
>> ----------------
>> I'm mildly bothered by using the same name for two different pieces of metadata.  Is there a reason not to use a different name here?
> Sorry, I don't follow. My intent is for function_entry_count to be
> another counter in the MD_prof family. For branches, we have
> branch_weights and for functions we have now function_entry_count.
> Perhaps I'm missing something?
>
>
> Thanks.  Diego.




More information about the llvm-commits mailing list