[PATCH] D30989: [PGO] Refactor the code for value profile annotation

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 11:00:50 PDT 2017


This is in the constructor.

Do you mean in the declaration point? I originally wrote that way. But I
could not use () operator. I had to write
std::vector<std::vector<Instruction *>> ValueSites =
std::vector<std::vector<Instruction *>>(IPVK_Last+1);

That was not as clean as a resize.

On Wed, Mar 15, 2017 at 10:44 AM, David Li via Phabricator <
reviews at reviews.llvm.org> wrote:

> davidxl accepted this revision.
> davidxl added a comment.
> This revision is now accepted and ready to land.
>
> lgtm
>
>
>
> ================
> Comment at: lib/Transforms/Instrumentation/PGOInstrumentation.cpp:389
>      NumOfPGOSelectInsts += SIVisitor.getNumOfSelectInsts();
> -    IndirectCallSites = findIndirectCallSites(Func);
> +    ValueSites.resize(IPVK_Last + 1);
> +    ValueSites[IPVK_IndirectCallTarget] = findIndirectCallSites(Func);
> ----------------
> use the constructor to set the size?
>
>
> https://reviews.llvm.org/D30989
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170315/70997308/attachment.html>


More information about the llvm-commits mailing list