[llvm-dev] Question about pickTracePred() in MachineTraceMetrics

Hsiangkai Wang via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 25 01:05:19 PST 2017


Hi stoklund,

I found that MachineTraceMetrics is created by you. I think it is a
bug in MachineTraceMetrics. Could you help me to review it? I have
created a patch for it.

https://reviews.llvm.org/D41572

In addition, I created a slide to write down some notes about
MachineTraceMetrics. I think it is helpful for someone interested in
MachineTraceMetrics implementation. Welcome to give me comments about
the slide.

https://www.slideshare.net/chimerawang/machine-trace-metrics-84887214

Thanks in advance,
Hsiangkai

On Thu, Dec 21, 2017 at 11:30 AM, Hsiangkai Wang <hsiangkai at gmail.com> wrote:
> Hi all,
>
> I have a question about MachineTraceMetrics.
>
> The definition of depth of block in MachineTraceMetrics is defined as
> the accumulated number of instructions in the trace above the block.
> Does not include instructions in this block.
>
> In MachineTraceMetrics::Ensemble::computeDepthResources(), we could
> see the definition when computing depth of a basic block as follow.
>
> TBI->InstrDepth = PredTBI->InstrDepth + PredFBI->InstrCount;
>
> TBI is current basic block's trace info.
> PredTBI is predecessor's trace info.
> PredFBI is predecessor's fixed trace info.
> That is, current block depth is summation of predecessor's depth and
> predecessor's instruction count.
>
> However, in MinInstrCountEnsemble::pickTracePred(), it uses
> predecessor's depth plus current basic block's instruction count as
> depth to pick the smallest one. Why? The summation is not aligned with
> the definition.
> Is there any reason to do so or is it a bug in MinInstrCountEnsemble?
>
> Thanks in advance.


More information about the llvm-dev mailing list