Commit Graph

5 Commits

Author SHA1 Message Date
Erik Eckstein
309b93ca15 Optimizer: add the isBarrierForDestroy utility
It checks if a destroy of a type must not be moved across an instruction.
2025-10-23 20:45:11 +02:00
Erik Eckstein
df20d36255 ClosureSpecialization: support for OSSA and a big overhaul
Beside supporting OSSA, this change significantly simplifies the pass.
The main change is that instead of starting at a closure (e.g. `partial_apply`) and finding all call sites, we now start at a call site and look for closures for all arguments. This makes a lot of things much simpler, e.g. not so many intermediate data structures are required to track all the states.

I needed to remove the 3 unit tests because the things those tests were testing are not there anymore. However, the pass is tested with a lot of sil tests (and I added quite a few), which should give good test coverage.

The old ClosureSpecializer pass is still kept in place, because at that point in the pipeline we don't have OSSA, yet. Once we have that, we can replace the old pass withe the new one.
However, the autodiff closure specializer already runs in the OSSA pipeline and there the new changes take effect.
2025-10-06 12:02:48 +02:00
Erik Eckstein
1eb49ec186 SwiftCompilerSources: move ForwardingUtils and BorrowUtils to the SIL module 2025-07-28 14:19:11 +02:00
Erik Eckstein
a767261fec SwiftCompilerSources: move the getAccessBaseTest to the SIL module 2025-07-28 14:19:10 +02:00
Erik Eckstein
e95283ba38 SwiftCompilerSources: make the testing infrastructure available in the SIL module
add `Test`, which is the SIL-equivalent of `FunctionTest`.
It's invocation closure gets a `TestContext` instead of a `FunctionContext`.

^ The commit message #2 will be skipped:

^ - test
2025-07-28 14:19:10 +02:00