swift
f1fc864d - SIL: fix the ownership computation of `struct_extract` and `tuple_extract`

Commit
298 days ago
SIL: fix the ownership computation of `struct_extract` and `tuple_extract` A struct or tuple value can have "none" ownership even if its type is not trivial. This happens when the struct/tuple contains a non-trivial enum, but it's initialized with a trivial enum case (e.g. with `Optional.none`). ``` %1 = enum $Optional<String>, #Optional.none!enumelt %2 = struct $S (%32) // has ownership "none" %3 = struct_extract %2, #S.x // should also have ownership "none" and not "guaranteed" ``` So far it got "guaranteed" ownership which is clearly wrong. Fixes an assertion crash in redundant load elimination. https://github.com/swiftlang/swift/issues/80430 rdar://148311534
Author
Committer
Parents
Loading