[PATCH] D16015: [PGO] Create the profile data variable before the lowering

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 8 15:47:14 PST 2016


On Fri, Jan 8, 2016 at 3:43 PM, Xinliang David Li <davidxl at google.com> wrote:
> You can always find the first counter incr instruction in the first
> loop. Then do the creation outside the first loop.

yes. that's true. I'll update the patch later using this method.

>
> David
>
> On Fri, Jan 8, 2016 at 3:32 PM, Rong Xu <xur at google.com> wrote:
>> On Fri, Jan 8, 2016 at 3:29 PM, David Li <davidxl at google.com> wrote:
>>> davidxl added inline comments.
>>>
>>> ================
>>> Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:155
>>> @@ +154,3 @@
>>> +    bool CounterVarSet = false;
>>> +    for (BasicBlock &BB : F) {
>>> +      if (CounterVarSet) break;
>>> ----------------
>>> Why not fuse this loop with the above one?
>>
>> It needs to know the number of indirect call sites in this function
>> which is set in  computeNumValueSiteCounts(Ind);
>> i.e fusing the two loops violate the dependence.
>>
>>>
>>>
>>> http://reviews.llvm.org/D16015
>>>
>>>
>>>


More information about the llvm-commits mailing list