Commits

Michael Gottesman committed 4208d36cf0b
[sil-combine] (struct_extract (load %x) #vardecl) -> (load (struct_element_addr %x #vardecl)) This peephole transforms struct_extract of a load into a load of a struct_element_addr. This eliminates unnecessary creation of a non-trivial non-reference counted types and additionally reduces the size of loads. An example of this from RC4 is: %24 = struct_element_addr %1 : $*RC4, #State // user: %25 %25 = struct_element_addr %24 : $*Slice<UInt8>, #count // user: %26 %26 = load %25 : $*Int64 // user: %29 ... %29 = struct_extract %26 : $Int64, #value // user: %30 %30 = apply %28(%29, %27) : $@thin (Builtin.Int64, Builtin.Int64) -> %Builtin.Int1 // user: %33 In this case there is no use of the load besides the struct_extract. This becomes even more interesting when the type one is attempting to retrieve from the non-trivial non-reference counted type is reference counted itself. Swift SVN r10605