Skip to content
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

IRGen: Mark async intrinsic helper functions as always inline #71414

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

aschwaighofer
Copy link
Contributor

github.com//issues/68708
rdar://115905828

@aschwaighofer
Copy link
Contributor Author

Please test with following PR:
swiftlang/llvm-project#8130

@swift-ci test

Copy link
Contributor

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

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

This looks fine from the debug info side!

@@ -263,6 +263,8 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts,
OptimizationLevel Level) {
if (Level != OptimizationLevel::O0)
MPM.addPass(createModuleToFunctionPassAdaptor(SwiftARCContractPass()));
if (Level == OptimizationLevel::O0)
MPM.addPass(AlwaysInlinerPass());
Copy link
Contributor

@felipepiovezan felipepiovezan Feb 8, 2024

Choose a reason for hiding this comment

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

Are we sure this (the instance added by this PR) is the only place the alwaysinline attribute is used? Because by adding an optimization pass at O0 we might be changing more than what we intended to change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default O0 llvm pass pipeline runs the AlwaysInlinerPass. Unfortunately just to early for our purposes i.e before Coro splitting.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks for the clarification!

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, at least as far as debugging is concerned, inlining is a 100% "reversible" operation, i.e., it should be transparent in the debugger.

@@ -263,6 +263,8 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts,
OptimizationLevel Level) {
if (Level != OptimizationLevel::O0)
MPM.addPass(createModuleToFunctionPassAdaptor(SwiftARCContractPass()));
if (Level == OptimizationLevel::O0)
MPM.addPass(AlwaysInlinerPass());
Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks for the clarification!

@aschwaighofer aschwaighofer merged commit 61326af into swiftlang:main Feb 8, 2024
5 checks passed
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.

None yet

3 participants