swift
5af76509 - [sil-combine] When deleting a dead partial_apply, insert a destroy for all non-trivial captured values.

Commit
8 years ago
[sil-combine] When deleting a dead partial_apply, insert a destroy for all non-trivial captured values. partial_apply is a confusing instruction since it: 1. Is printed with a function signature. 2. Takes in some arguments of the same type as the underlying types of the given function signatures. 3. Always takes in those arguments at +1 regardless of the convention printed on the partial apply. Eventually we will split the partial apply representation so that the box is represnted explicitly separately from the function signature, eliminating this confusion. The problem that we ran into here is that we were not treating @in values from an alloc_stack or @in_guaranteed at all correctly. The reason why the tests did not catch this is that a seperate sil_combine optimization that eliminates trivially dead live ranges was eliminting the alloc_stack of the @in value in our test. In contrast, the @in_guaranteed case was actually never tested at all. I added tests for all of these conventions and in addition added a special mode to SILCombine that stops the alloc_stack eliminating during testing. rdar://32887993
Author
Committer
Parents
Loading