Commit Graph

8 Commits

Author SHA1 Message Date
Erik Eckstein
ddea9f6aa0 Optimizer: switch to the new ConstantCapturePropagation pass in the pass pipeline 2025-09-04 08:15:46 +02:00
Erik Eckstein
6ccd1aceed Optimize keypaths in language 6 mode
In language 6 mode keypath instructions are created as existentials and the optimizer needs to look through the `open_existential_ref` instructions to recognize a keypath.

rdar://150173106
2025-04-28 15:52:18 +02:00
Erik Eckstein
25873407ad CapturePropagation: handle existential keypaths
Handle open_existential_ref instructions which cast keypath instructions before they are passed to a partial_apply.
In Swift language mode 6 keypaths are existentials (e.g. `any WritableKeyPath<Str, Int> & Sendable`) and we need to deal with that in CapturePropagation.

rdar://141370412
2025-03-06 16:48:01 +01:00
Erik Eckstein
750d6ec81b CapturePropagation: handle keypaths which are upcast.
Deal with upcast instructions which cast keypath instructions before they are passed to a partial_apply.

rdar://141370412
2024-12-13 07:51:36 +01:00
Anton Korobeynikov
121e28051a Force escaping all thin functions. Ensure types are always unique. 2022-04-20 10:34:45 +02:00
Saleem Abdulrasool
36c951d31e Revert "[DebugInfo] Ignore noescape bit for all @convention(c) pointers" 2022-04-19 18:09:23 -07:00
Anton Korobeynikov
0258ed3209 Force escaping all thin functions. Ensure types are always unique. 2022-04-18 22:43:57 +02:00
Erik Eckstein
34d79e3799 CapturePropagation: specialize closures which capture a constant keypath
This optimizes keypath-closures, like
```
   a.map { \.x }
```
It results in a significant performance improvement for such code patterns.

rdar://87968067
2022-02-01 09:22:07 +01:00