Skip to content

[Serialization] Add ModuleSummary serialization format #33400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Aug 11, 2020

This will be unblocked when #33324 merged.

This PR adds the actual serialization and deserialization implementation of module summary which will be used for cross dead function elimination.

The module summary file consists of function summaries and virtual function tables.

Function Summary

A function summary has a globally unique identifier and function call info. The function call info indicates how the callee function is referenced (e.g. witness_method, class_method or function_ref).

Virtual Function Table

A virtual function table has a map of virtual method to implementations.

protocol P {
  func foo1()
}

struct S1: P {
  func foo1() {}
}
struct S2: P {
  func foo1() {}
}

For example, this code will be summarized into

witness_tables:
  P.foo1:
    - S1.foo1
    - S2.foo2

For more info: https://forums.swift.org/t/refactoring-plan-of-silvisitor-for-lto/37678/14

CC: @compnerd @gottesmm

@kateinoigakukun kateinoigakukun force-pushed the katei/swift-module-summary/serialization branch 3 times, most recently from eaaa389 to ef0df0e Compare August 15, 2020 01:48
@kateinoigakukun kateinoigakukun force-pushed the katei/swift-module-summary/serialization branch 2 times, most recently from 7b9513f to 3bc89af Compare September 10, 2020 10:21
@kateinoigakukun kateinoigakukun marked this pull request as ready for review September 10, 2020 10:21
@kateinoigakukun kateinoigakukun force-pushed the katei/swift-module-summary/serialization branch from 3bc89af to 43089c3 Compare September 10, 2020 10:47
@MaxDesiatov

This comment has been minimized.

@kateinoigakukun kateinoigakukun force-pushed the katei/swift-module-summary/serialization branch from 43089c3 to e80ceb0 Compare September 16, 2020 03:20
@MaxDesiatov

This comment has been minimized.

@kateinoigakukun kateinoigakukun force-pushed the katei/swift-module-summary/serialization branch from e80ceb0 to f2ddbca Compare September 19, 2020 04:44
@MaxDesiatov MaxDesiatov changed the base branch from master to main September 24, 2020 08:43
@MaxDesiatov

This comment has been minimized.

@kateinoigakukun kateinoigakukun force-pushed the katei/swift-module-summary/serialization branch from f2ddbca to 524629b Compare September 26, 2020 15:17
@MaxDesiatov

This comment has been minimized.

@kateinoigakukun kateinoigakukun force-pushed the katei/swift-module-summary/serialization branch from 524629b to 071b9e1 Compare September 28, 2020 23:35
@MaxDesiatov
Copy link
Contributor

@swift-ci please smoke test

@kateinoigakukun kateinoigakukun force-pushed the katei/swift-module-summary/serialization branch from 071b9e1 to 777969a Compare October 3, 2020 03:00
@MaxDesiatov
Copy link
Contributor

@swift-ci please smoke test

@kateinoigakukun
Copy link
Member Author

Finally, CI passed

@MaxDesiatov
Copy link
Contributor

@compnerd @gottesmm would you be able to have a look at this please?

@kateinoigakukun
Copy link
Member Author

Close as it's too stale for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants