mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This is the first in a sequence of patches that implement various optimizations to transform load [copy] into load_borrow. The optimization works by looking for a load [copy] that: 1. Only has destroy_value as consuming users. This implies that we do not need to pass off the in memory value at +1 and that we can use a +0 value. 2. Is loading from a memory location that is never written to or only written to after all uses of the load [copy]. and then RAUW the load [copy] with a load_borrow and convertes the destroy_value to end_borrow. NOTE: I also a .def file for AccessedStorage so we can do visitors over the kinds. The reason I want to do this is to ensure that people update these optimizations if we add new storage kinds.
17 KiB
17 KiB