Skip to content

SILCombine: handle upcasts when converting from alloc_ref_dynamic to alloc_ref #5140

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
Oct 6, 2016

Conversation

eeckstein
Copy link
Contributor

No description provided.

@eeckstein
Copy link
Contributor Author

@swift-ci Please smoke test and merge

Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

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

Can you improve the commit message with what was missing here and what prompted the change here? (Is there a radar?)

@gottesmm
Copy link
Contributor

gottesmm commented Oct 5, 2016

(btw, the only reason I requested the changes was to stop the merge from the smoke test.)

…alloc_ref

We transform an "alloc_ref_dynamic(metatype @thick $T)" to an "alloc_ref $T"
But in some cases there can be an upcast in-between.
Now we also do "alloc_ref_dynamic(upcast(metatype @thick $Derived) to  $Base)" -> "upcast(alloc_ref $Derived) to $Base"

This peephole optimization is needed for the upcoming change of using tail allocated arrays in ManagedBuffer.
@eeckstein eeckstein force-pushed the silcombine-alloc-ref-dynamic branch from 502f581 to bf7ac4a Compare October 5, 2016 23:50
@gottesmm
Copy link
Contributor

gottesmm commented Oct 5, 2016

Looks great Erik!

@eeckstein
Copy link
Contributor Author

@swift-ci Please smoke test and merge

@eeckstein eeckstein merged commit 352386b into swiftlang:master Oct 6, 2016
@eeckstein eeckstein deleted the silcombine-alloc-ref-dynamic branch October 6, 2016 00:35
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