Skip to content

RedundantLoadElimination: support replacing a redundant copy_addr with a store#80912

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
Apr 23, 2025

Conversation

eeckstein
Copy link
Contributor

For example:

 %0 = load %1 copy_addr %1 to %2 

->

 %0 = load %1 store %0 to %2 

This is important for MandatoryRedundantLoadElimination to be able to create statically initialized globals in the mandatory pipeline. For example:

public struct MyStruct { public static let r: Range<Int> = 1 ..< 3 } 

gets a statically initialized global, even at Onone, with this improvement.

rdar://149356742

@eeckstein
Copy link
ContributorAuthor

…ith a `store` For example: ``` %0 = load %1 copy_addr %1 to %2 ``` -> ``` %0 = load %1 store %0 to %2 ``` This is important for MandatoryRedundantLoadElimination to be able to create statically initialized globals in the mandatory pipeline. For example: ``` public struct MyStruct { public static let r: Range<Int> = 1 ..< 3 } ``` gets a statically initialized global, even at Onone, with this improvement. rdar://149356742
@eeckstein
Copy link
ContributorAuthor

Copy link
Contributor

@meg-guptameg-gupta left a comment

Choose a reason for hiding this comment

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

lgtm

@eecksteineeckstein merged commit 8226f20 into swiftlang:mainApr 23, 2025
5 checks passed
@eecksteineeckstein deleted the copyaddr-in-rle branch April 23, 2025 18:59
@kubamracek
Copy link
Contributor

Very cool, thanks, Erik! :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
@eeckstein@kubamracek@meg-gupta
close