Commit Graph

7 Commits

Author SHA1 Message Date
eeckstein
b6639e1782 Merge pull request #79314 from eeckstein/fix-simplify-keypath
SimplifyKeyPath: insert the correct destroy operation for an operand of a removed keypath
2025-02-12 15:18:39 +01:00
Erik Eckstein
3f95ce9645 Optimizer: fix spelling of the Simplifiable protocol
Rename `Simplifyable` -> `Simplifiable`

NFC
2025-02-12 09:01:11 +01:00
Erik Eckstein
2962474b58 SimplifyKeyPath: insert the correct destroy operation for an operand of a removed keypath
If the operand is an address, we need to use `destroy_addr` and not `destroy_value`.

Fixes a compiler crash.
rdar://144662171
2025-02-12 08:35:23 +01:00
Erik Eckstein
d9fc62e54a SimplifyKeyPath: remove dead keypath instructions also in non-OSSA
which means: handle of strong_release instructions
2024-05-16 09:32:08 +02:00
Kuba Mracek
33e89c0aad [embedded] Consider move_value/copy_value as removable for keypath optimization 2024-04-22 13:33:24 -07:00
Kuba Mracek
796554f55d [embedded] Respect ownership in SimplifyKeyPath, emit destroy_value instructions for keypath operands 2024-03-21 17:54:05 -07:00
Kuba Mracek
b642d771be [embedded] Compile-time (literal) KeyPaths for Embedded Swift
Enable KeyPath/AnyKeyPath/PartialKeyPath/WritableKeyPath in Embedded Swift, but
for compile-time use only:

- Add keypath optimizations into the mandatory optimizations pipeline
- Allow keypath optimizations to look through begin_borrow, to make them work
  even in OSSA.
- If a use of a KeyPath doesn't optimize away, diagnose in PerformanceDiagnostics
- Make UnsafePointer.pointer(to:) transparent to allow the keypath optimization
  to happen in the callers of UnsafePointer.pointer(to:).
2024-03-20 15:35:46 -07:00