[PATCH] D83265: [MBP] Use profile count to compute tail dup cost if it is available

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 16:45:46 PDT 2020


Carrot created this revision.
Carrot added a reviewer: davidxl.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

Current tail duplication in machine block placement pass uses block frequency information in cost model. But frequency number has only relative meaning compared to other basic blocks in the same function. A large frequency number doesn't mean it is hot and a small frequency number doesn't mean it is cold.

To overcome this problem, this patch uses profile count in cost model if it's available. So we can tail duplicate real hot basic blocks.

When tested with spec2006int, the performance doesn't change, the number of tail duplicated blocks was reduced from 2376 to 1746.

In our internal testing, search1 was not impacted, search2 was improved by 0.1%, another 0.1% can be achieved with larger threshold parameter.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83265

Files:
  llvm/lib/CodeGen/MachineBlockPlacement.cpp
  llvm/test/CodeGen/X86/dup-cost.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83265.275860.patch
Type: text/x-patch
Size: 7035 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200706/8bf23739/attachment.bin>


More information about the llvm-commits mailing list