Files
Erik Eckstein a9e02f7695 DestroyAddrHoisting: look through index_addr when checking for an unchecked_addr_cast
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.
2026-11-18 07:37:26 +01:00
..