Skip to content

Redo the Pass Manager #206

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

Merged
merged 6 commits into from
May 25, 2019
Merged

Redo the Pass Manager #206

merged 6 commits into from
May 25, 2019

Conversation

CodaFi
Copy link
Member

@CodaFi CodaFi commented May 1, 2019

This thing was never correct. We mixed up Function passes and Module passes, and if you were unlucky enough to schedule both into the function pass manager then LLVM would probably crash.

Provide the interface we were shooting for here anyways in the form of a Swift-like pass pipeliner. You can freely mix module and function-level passes in the pipeliner, and we will schedule them the way LLVM would anyways (group the function passes, then run the module passes). There's bindings for LTO passes that never made it into a header that we could also wrap with this infrastructure.

.globalDCE,
.deadArgElimination,
.ipConstantPropagation,
.ipscc:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe at least .functionAttrs should be here too.

@CodaFi CodaFi force-pushed the dont-pass-me-by branch 3 times, most recently from 51711ec to 6c35b53 Compare May 1, 2019 23:24
Copy link
Collaborator

@matthewseaman matthewseaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great!

@@ -106,8 +106,6 @@ public enum FunctionPass {
case scalarReplAggregates
/// Replace aggregates or pieces of aggregates with scalar SSA values.
case scalarReplAggregatesSSA
/// Tries to inline the fast path of library calls such as sqrt.
case simplifyLibCalls
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The corresponding add pass function is a no-op as the pass has been removed.

@CodaFi CodaFi force-pushed the dont-pass-me-by branch from ecce906 to 954fa0d Compare May 25, 2019 21:21
CodaFi added 3 commits May 25, 2019 14:23
All the SROA variants in the C API no longer make a difference.
This finally allows us to wrap passes that require additional parameters or configuration calls.

In order to do this for internalize in particular, we have to do some heroic lifetime juggling.
@CodaFi CodaFi force-pushed the dont-pass-me-by branch from 954fa0d to 10dd489 Compare May 25, 2019 21:27
@CodaFi CodaFi marked this pull request as ready for review May 25, 2019 21:38
@CodaFi
Copy link
Member Author

CodaFi commented May 25, 2019

⛵️

@CodaFi CodaFi merged commit 8284325 into llvm-swift:master May 25, 2019
@CodaFi CodaFi deleted the dont-pass-me-by branch May 25, 2019 21:47
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