Skip to content

Expose the LowerHopToActorPass as API so LLDB can schedule it #37123

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 1 commit into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/swift/SILOptimizer/PassManager/PassPipeline.def
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#endif

PASSPIPELINE(Diagnostic, "Guaranteed Passes")
PASSPIPELINE(LowerHopToActor, "Lower Hop to Actor")
PASSPIPELINE(OwnershipEliminator, "Utility pass to just run the ownership eliminator pass")
PASSPIPELINE(Performance, "Passes run at -O")
PASSPIPELINE(Onone, "Passes run at -Onone")
Expand Down
5 changes: 4 additions & 1 deletion include/swift/SILOptimizer/PassManager/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ namespace swift {
/// Run all SIL passes for -Onone on module \p M.
void runSILPassesForOnone(SILModule &M);

/// Run the SIL ownership eliminator pass on \p M.
/// Run the SIL lower hop-to-actor pass on \p M.
bool runSILLowerHopToActorPass(SILModule &M);

/// Run the SIL ownership eliminator pass on \p M.
bool runSILOwnershipEliminatorPass(SILModule &M);

void runSILOptimizationPassesWithFileSpecification(SILModule &Module,
Expand Down
8 changes: 8 additions & 0 deletions lib/SILOptimizer/PassManager/PassPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ SILPassPipelinePlan::getDiagnosticPassPipeline(const SILOptions &Options) {
return P;
}

SILPassPipelinePlan SILPassPipelinePlan::getLowerHopToActorPassPipeline(
const SILOptions &Options) {
SILPassPipelinePlan P(Options);
P.startPipeline("Lower Hop to Actor");
P.addLowerHopToActor();
return P;
}

//===----------------------------------------------------------------------===//
// Ownership Eliminator Pipeline
//===----------------------------------------------------------------------===//
Expand Down
10 changes: 10 additions & 0 deletions lib/SILOptimizer/PassManager/Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ bool swift::runSILDiagnosticPasses(SILModule &Module) {
return Ctx.hadError();
}

bool swift::runSILLowerHopToActorPass(SILModule &Module) {
auto &Ctx = Module.getASTContext();

auto &opts = Module.getOptions();
executePassPipelinePlan(
&Module, SILPassPipelinePlan::getLowerHopToActorPassPipeline(opts));

return Ctx.hadError();
}

bool swift::runSILOwnershipEliminatorPass(SILModule &Module) {
auto &Ctx = Module.getASTContext();

Expand Down