Skip to content

[SR-9223] Inliner exhibits slow compilation time with a large static array #51712

Closed as not planned
@swift-ci

Description

@swift-ci
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 bd28b0e (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.

Metadata

Metadata

Assignees

Labels

SILOptimizerArea → compiler: SIL optimization passesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfduplicateResolution: Duplicates another issueexpressionsFeature: expressionsliteralsFeature → expressions: Literals such as an integer or string literaloptimized onlyFlag: An issue whose reproduction requires optimized compilationperformanceswift 5.8

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions