Commits

Michael Gottesman committed 816c2a13985
[sil-combine] Do not transform (struct_extract (load)) -> (load (struct_element_addr)) when the load has multiple uses. Do the same for the tuple_extract optimization. After turning this off I am starting to see a bunch of code like this: %69 = load %1#1 : $*Array<T> // users: %77, %70 %70 = struct_extract %69 : $Array<T>, #owner // user: %73 %71 = struct_element_addr %1#1 : $*Array<T>, #owner // user: %72 %72 = load %71 : $*Builtin.ObjectPointer // user: %74 strong_retain %70 : $Builtin.ObjectPointer // id: %73 strong_release %72 : $Builtin.ObjectPointer // id: %74 dealloc_stack %1#0 : $*@local_storage Array<T> // id: %75 strong_release %2 : $Builtin.ObjectPointer // id: %76 return %69 : $Array<T> // id: %77 Which confuses the ARC optimizer (notice the struct_extract vs struct_element_addr). I imagine we will want to canonicalize this case in a different way (maybe an inverse peephole that would turn in this case the struct_element_addr + load -> load + struct_extract?). Swift SVN r12305