swift: [SR-9223] Inliner exhibits slow compilation time with a large static array

Previous ID SR-9223
Radar None
Original Reporter andreasw (JIRA User)
Type Bug
Status Reopened
Resolution

Attachment: Download

Environment

Makefile

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee @atrick
Priority Medium

md5: c44b8d1ce0417361133fc33640032956

Issue Description:

Hi!

Please see the attached Makefile and perf report. This time it’s the inliner (and verifier).

With 5.000 elements compiling takes less than 3 seconds, with 10.000 more than 15, with 15.000 37 seconds.

It seems that commit bd28b0ea1b6ab1e981e1e591e10c42d5adcf71af (SILCloner and SILInliner rewrite) is the culprit.

+ 71,47% 0,06% swift swift [.] runOnFunctionRecursively ◆
+ 71,29% 0,01% swift swift [.] swift::SILInliner::inlineFunction ▒
+ 71,22% 0,02% swift swift [.] swift::SILInlineCloner::cloneInline ▒

-   70,39% 70,19% swift swift [.] llvm::ilist_traits<swift::SILInstruction>::transferNodesFromList ▒
    70,19% runOnFunctionRecursively ▒
    swift::SILInliner::inlineFunction ▒
    + swift::SILInlineCloner::cloneInline ▒
    + 35,74% 0,01% swift swift [.] swift::mergeBasicBlockWithSuccessor ▒
    + 35,69% 0,01% swift swift [.] swift::mergeBasicBlockWithSingleSuccessor ▒
    + 35,63% 0,03% swift swift [.] swift::SILBasicBlock::spliceAtEnd ▒
    + 34,80% 0,04% swift swift [.] swift::SILBasicBlock::split ▒
    + 20,74% 0,04% swift swift [.] swift::SILFunction::verify ▒
    + 20,38% 0,26% swift swift [.] (anonymous namespace)::SILVerifier::visitSILBasicBlock ▒
    + 20,07% 0,13% swift swift [.] swift::SILInstructionVisitor<(anonymous namespace)::SILVerifier, void>::visit ▒
    + 19,46% 18,37% swift swift [.] (anonymous namespace)::SILVerifier::visitSILInstruction ▒
    + 17,22% 0,00% swift swift [.] swift::SILModule::verify

The functions inlined are from the builtin UInt and Array classes.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 32 (12 by maintainers)

Most upvoted comments

Current stats make this a duplicate of #50243. Closing in favor of the older issue.