This is an archive of the discontinued LLVM Phabricator instance.

[MachineTraceMetrics] Fix bug in pickTracePred
Needs ReviewPublic

Authored by HsiangKai on Dec 25 2017, 12:51 AM.

Details

Summary

The definition of InstrDepth for a basic block is the accumulated number
of instructions in the trace above the block, excluding instructions in
the block. When we pick the best trace predecessor, we should consider
the block depth of each predecessor and pick the smallest one. The
original implementation uses current block's InstrCount to calculate
predecessors' InstrDepth. It should be fixed to use predecessors'
InstrCount instead of current block's InstrCount.

Diff Detail

Event Timeline

HsiangKai created this revision.Dec 25 2017, 12:51 AM
thegameg edited reviewers, added: MatzeB; removed: thegameg.Aug 16 2018, 7:40 AM
thegameg added a subscriber: thegameg.

Sorry, I'm afraid I can't help reviewing this patch as I know nothing about MachineTraceMetrics. Although, I suggest adding a test case, as it will help reviewers to understand better what the changes are.