[PATCH] D94981: [LiveDebugVariables] Add cache for SkipPHIsLabelsAndDebug to prevent iterating the same set of PHI/LABEL/Debug instructions repeatedly.

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 09:58:30 PST 2021


wmi created this revision.
wmi added reviewers: dblaikie, aprantl.
Herald added subscribers: wenlei, hiraditya.
wmi requested review of this revision.
Herald added a project: LLVM.

We run into a compiling timeout problem when building a target after its SampleFDO profile is updated. It is because some very large blocks with a bunch of PHIs at the beginning. LiveDebugVariables::emitDebugValues called during VirtRegRewriter phase searchs the insertion point for those large BBs repeatedly in SkipPHIsLabelsAndDebug, and each time SkipPHIsLabelsAndDebug needs to go through the same set of PHIs before it can find the first non PHI/Label/Debug instruction as an insertion point. This patch adds a cache to save the last position for the sequence which has been checked in the previous call of SkipPHIsLabelsAndDebug.


Repository:
  rL LLVM

https://reviews.llvm.org/D94981

Files:
  llvm/lib/CodeGen/LiveDebugVariables.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94981.317608.patch
Type: text/x-patch
Size: 8804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210119/6643ec95/attachment.bin>


More information about the llvm-commits mailing list