You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
#80430
rdar://148311534
0 commit comments