mirror of
https://github.com/apple/swift.git
synced 2026-11-24 07:03:51 +01:00
An `index_addr` with a zero index doesn't change the AccessPath. Therefore it can appear between an `unchecked_addr_cast`, which casts a vector to its first element, and the destroyed address: ``` %1 = unchecked_addr_cast %vector to $*Element %2 = index_addr %1, 0 destroy_addr %2 ``` Without looking through the `index_addr`, DestroyAddrHoisting would hoist the destroy and replace it with a `destroy_addr` of the whole vector. Fixes a mis-compile which shows up in test/Prototypes/Vector.swift once `index_addr` instructions with a zero index are not removed anymore.