Commits
Chris Lattner committed 13b89db2e21
implement a new optimization to completely eliminate objects when they
don't escape and are only stored to. This is common because other general
LLVM optimizations often forward propagate all the loads out of an object,
making it pointless. This implements rdar://11542745, compiling that example
to:
define void @_T1t1PFT_T_() nounwind {
entry:
tail call void @putchar(i32 32) nounwind
ret void
}
and rdar://11542766 (eliminating the temporary forced onto the stack by &&), compiling
it into:
define i32 @_T1t4testFT1aNSs4Char_NSs6UInt32(i32 %a) nounwind {
entry:
%a.off = add i32 %a, -33
%0 = icmp ult i32 %a.off, 95
%return_value.0.0 = select i1 %0, i32 4, i32 7
ret i32 %return_value.0.0
}
This also deletes 19 objects in the stdlib, though it wildly changes inlining
behavior, so it is hard to exactly measure the impact.
Swift SVN r2052