Skip to content

Fix bugs that caused IRGen to behave differently when debug info was … #16933

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
Jun 1, 2018

Conversation

adrian-prantl
Copy link
Contributor

@adrian-prantl adrian-prantl commented May 31, 2018

…enabled.

It hass been a longstanding principle in LLVM that the presence of
debug info shall not affect code generation. This patch brings the
Swift frontend closer to this ideal:

  • unconditionally emit shadow copies
  • unconditionally bind type metadata

The extra allocas, bitcasts, geps, and stores being emitted get
optimized away when compiling at anything but -Onone. There are few
use-cases for compiling at -Onone without -g, so this shouldn't affect
performance for any real-world use-cases.

rdar://problem/26633363

@adrian-prantl adrian-prantl requested a review from dcci May 31, 2018 23:54
@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

Copy link
Member

@dcci dcci left a comment

Choose a reason for hiding this comment

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

LGTM

@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

/// Force all archetypes referenced by the type to be bound by this point.
/// TODO: just make sure that we have a path to them that the debug info
/// can follow.
void bindArchetypes(swift::Type Ty) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if lldb only required type metadata for top-level generic arguments, and not any referenced associated types. Can you file a radar to fix that? It would be feasible to tackle this once you're able to use remote mirrors to calculate layouts (remote mirrors doesn't require metadata instantiation in the target).

@adrian-prantl adrian-prantl force-pushed the irgen-g branch 2 times, most recently from d3dac0d to c71c736 Compare June 1, 2018 16:37
@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

2 similar comments
@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

…enabled.

It hass been a longstanding principle in LLVM that the presence of
debug info shall not affect code generation. This patch brings the
Swift frontend closer to this ideal:

- unconditionally emit shadow copies
- unconditionally bind type metadata

The extra allocas, bitcasts, geps, and stores being emitted get
optimized away when compiling at anything but -Onone. There are few
use-cases for compiling at -Onone without -g, so this shouldn't affect
performance for any real-world use-cases.
@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

1 similar comment
@adrian-prantl
Copy link
Contributor Author

@swift-ci test and merge

@swift-ci swift-ci merged commit c246626 into swiftlang:master Jun 1, 2018
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.

4 participants