[PATCH] Add function entry count metadata.

Diego Novillo dnovillo at google.com
Tue May 12 14:59:45 PDT 2015


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