[PATCH] D80589: [NewPM] Avoid redundant CGSCC run for updated SCC

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 26 14:11:24 PDT 2020


wenlei created this revision.
wenlei added reviewers: chandlerc, wmi.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
wenlei edited the summary of this revision.
wenlei added a subscriber: davidxl.
Herald added a subscriber: dexonsmith.

When an SCC got split due to inlining, we have two mechanisms for reprocessing the updated SCC, first is UR.UpdatedC
that repeatedly rerun the new, current SCC; second is a worklist for all newly split SCCs. We can avoid rerun of
the same SCC when the SCC is set to be processed by both mechanisms *back to back*. In pathological cases, such redundant
rerun could cause exponential size growth due to inlining along cycles, even when there's no SCC mutation and hence
convergence is not a problem.

Note that it's ok to have SCC updated and rerun immediately, and also in the work list if we have actually moved an SCC
to be topologically "below" the current one due to merging. In that case, we will need to revisit the current SCC after
those moved SCCs. For that reason, the redundant avoidance here only targets back to back rerun of the same SCC - the
case described by the now removed FIXME comment.

Testing:
Verified compile time for internal repro dropped from 8hr+ to 1hr+.
Verified SPEC2017 performance w/ and w/o this patch is neutral (ThinLTO+NewPM).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80589

Files:
  llvm/include/llvm/Analysis/CGSCCPassManager.h
  llvm/test/Transforms/Inline/cgscc-cycle-debug.ll
  llvm/unittests/Analysis/CGSCCPassManagerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80589.266329.patch
Type: text/x-patch
Size: 6073 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200526/4915373e/attachment.bin>


More information about the llvm-commits mailing list