Erik Eckstein
6ff3b91fe4
SimplifyDestructure: support simplifying a destructure_struct with a copy_value in place
...
Replace
```
%s = struct (%0, %1, %2)
%c = copy_value %s // can also be a chain of multiple copies
(%3, %4, %5) = destructure_struct %c
```
with
```
%c0 = copy_value %0
%c1 = copy_value %1
%c2 = copy_value %2
%s = struct (%0, %1, %2) // keep the original struct
```
and replace the results %3, %4, %5 with %c0, %c1, %c2, respectively.
2023-11-09 18:34:53 +01:00
Erik Eckstein
5a3ab6ee2e
Swift Optimizer: add simplifications for destructure_struct and destructure_tuple
...
Eliminate the redundant instruction pair
```
%t = tuple (%0, %1, %2)
(%3, %4, %5) = destructure_tuple %t
```
and replace the results %3, %4, %5 with %0, %1, %2, respectively.
The same for structs.
2023-05-08 21:23:36 +02:00