Commit Graph

4 Commits

Author SHA1 Message Date
Kuba (Brecka) Mracek
e34c20fdf5 Merge pull request #67243 from kubamracek/section-ump
Allow forced constant-folding of global initializers to work on UnsafeMutablePointer types
2023-07-13 20:07:05 -07:00
Kuba Mracek
c09710bc9a Enhance enum simplifications in SILOptimizer to allow forced constant-folding of global initializers to work on UnsafeMutablePointer types 2023-07-13 08:31:53 -07:00
Erik Eckstein
efcd90af7d Swift SIL: rename ownership enums and properties in LoadInst and StoreInst
`ownership` is a bad name in `LoadInst`, because it hides `Value.ownership`.
Therefore rename it to `loadOwnership`.
Do the same for ownership in StoreInst to be consistent.
2023-07-11 22:33:02 +02:00
Erik Eckstein
3747a2830e Optimizer: add simplification for init_enum_data_addr
Optimize the sequence
```
  %1 = init_enum_data_addr %enum_addr, #someCaseWithPayload
  store %payload to %1
  inject_enum_addr %enum_addr, #someCaseWithPayload
```
to
```
  %1 = enum  $E, #someCaseWithPayload, %payload
  store %1 to %enum_addr
```
This sequence of three instructions must appear in consecutive order.
But usually this is the case, because it's generated this way by SILGen.
2023-05-25 16:28:41 +02:00