mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This is in prepration for other bug fixes. Clarify the SIL utilities that return canonical address values for formal access given the address used by some memory operation: - stripAccessMarkers - getAddressAccess - getAccessedAddress These are closely related to the code in MemAccessUtils. Make sure passes use these utilities consistently so that optimizations aren't defeated by normal variations in SIL patterns. Create an isLetAddress() utility alongside these basic utilities to make sure it is used consistently with the address corresponding to formal access. When this query is used inconsistently, it defeats optimization. It can also cause correctness bugs because some optimizations assume that 'let' initialization is only performed on a unique address value. Functional changes to Memory Behavior: - An instruction with side effects now conservatively still has side effects even when the queried value is a 'let'. Let values are certainly sensitive to side effects, such as the parent object being deallocated. - Return the correct MemBehavior for begin/end_access markers.
3.0 KiB
3.0 KiB