mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We have to guarantee memory safety in the presence of the user violating the inout assumption. Claiming NoAlias for parameters that might alias is not memory safe because LLVM will optimize based on that assumption. Unfortunately, this means that llvm can't optimize arrays as aggressively. For example, the load of array->buffer won't get hoisted out of loops (this is the Sim2DArray regression below). -O numbers (before/after): CaptureProp 0.888365 Chars 1.09143 ImageProc 0.917197 InsertionSort 0.895204 JSONHelperDeserialize 0.909717 NSDictionaryCastToSwift 0.923466 Sim2DArray 0.76296 SwiftStructuresBubbleSort 0.897483 Continue emitting noalias for inout when compiling Ounchecked. rdar://20041458 Swift SVN r25770
38 KiB
38 KiB