Skip to content

Conversation

hamishknight
Copy link
Contributor

This is already fixed for the new pass manager, add a test case and apply the fix to the legacy pass manager too (cherry-pick of #38197). This prevents LLVM from optimizing out a profiler increment before lowering it, ensuring that we still emit name data for the coverage mapping, even if the increment itself gets optimized out.

This doesn't help in cases where the SIL optimizer optimizes out a profiler increment, but in that case we decline to emit the coverage mapping, so the result is lost coverage instead of a malformed mapping. I'm tracking fixing that in rdar://99813754.

rdar://77217762

Ensure that LLVM doesn't optimize out a profiler
increment before lowering it, ensuring its name
gets recorded.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit c963a90 into swiftlang:main Sep 15, 2022
@hamishknight hamishknight deleted the cant-pass-this-up branch September 15, 2022 16:02
Copy link
Contributor

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

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

👍

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