Commit Graph

8137 Commits

Author SHA1 Message Date
Slava Pestov
aa62cfdcbb Merge pull request #87037 from slavapestov/prune-disjunctions-toll-free-bridge
Sema: Teach disjunction pruning about CF toll-free bridging
2026-02-06 17:38:31 -05:00
Slava Pestov
21abe01557 Sema: Teach canPossiblyConvertTo() about CF toll-free bridging 2026-02-06 12:47:33 -05:00
Slava Pestov
22fdb62e51 Sema: Add a couple of type checker performance tests 2026-02-06 12:47:33 -05:00
Kavon Farvardin
ae77ba81e3 Merge pull request #87013 from kavon/revert-84789
Back out #84789 after additional testing
2026-02-06 02:58:00 -08:00
Kavon Farvardin
53426c5146 validation-test: update now non-crashing test 2026-02-05 17:41:52 -08:00
Slava Pestov
b9ac0b7cef Sema: Add slow expression reduced from earlier swift-testing version 2026-02-05 11:15:18 -05:00
Slava Pestov
437589d1b6 Merge pull request #86950 from slavapestov/remove-more-solver-hacks
Sema: Add flag to disable more solver performance hacks
2026-02-04 08:13:31 -05:00
Kavon Farvardin
006a0a494a Reparenting: require an extension
This change forces you to write ``@reparented` relationships
on an extension of a protocol, rather than on the protocol
itself.

The ProtocolConformance needs to be associated with some
GenericContext and IRGen expects it to be an ExtensionDecl.
That environment defines under what conditions the conformance
exists. We also need to define witnesses for the new parent's
requirements in an extension anyway, so it's a natural fit.

The previous workaround for this was kind of awful, as it'd
require searching all the protocol's extensions and "guess"
which extension they want to represent the conformance. While
we could try to synthesize an extension, there's two
challenges there:

1. Due to SuppressedAssociatedTypes, it's not so simple to
synthesize an unconstrained ExtensionDecl.
2. We currently rely on same-type requirements to pin the
associated types to particular witnesses of those requirements
in the extension. So it's not purely unconstrained! For example,

```
extension Seq: @reparented BorrowSeq where Iter == MyIter {}
```

The constraints that are disallowed (but not yet diagnosed)
are conditional conformance requirements, as the default
conformance for a reparenting cannot depend on those.

Thus, it's better that programmers to specify the extension.
2026-02-03 16:40:21 -08:00
Kavon Farvardin
eb7fe3c8a3 Reparenting: initial functionality 2026-02-03 16:39:19 -08:00
Slava Pestov
2e60d29973 Sema: Add -solver-{disable,enable}-performance-hacks flags 2026-02-03 16:34:10 -05:00
Slava Pestov
061958f970 Sema: Eagerly filter out protocol extension operators
This optimizes for the case where we have a disjunction that contains an
operator defined in a protocol, and a protocol defined in a protocol
extension, and furthermore, the protocol extension operator's type is a
refinement of the protocol requirement operator's type.

In this case, there are three possibilities:

- Either the operator requirement is witnessed by a concrete operator
  in the conforming type, in which case the solution involving the
  protocol extension operator is going to be worse, so we can skip this
  choice.

- Otherwise, the protocol requirement operator is witnessed by the same
  protocol extension operator that we skipped, in which case we will find
  the same solution if we just pick the protocol requirement operator
  anyway.

- The only other possibility is that the protocol requirement operator
  is witnessed by a protocol extension operator, but also, a more
  refined protocol extension operator exists. However, it appears that in
  this case, solution ranking _also_ picks the solution involving the
  protocol requirement operator, as the new test case demonstrates.

Thus, we gain nothing by considering these protocol extension operators.
Skip them when forming the disjunction.
2026-02-03 16:34:09 -05:00
Slava Pestov
1184646abb Sema: Add test case where declaration order determines expression complexity
This is a reduction of the problem from rdar://168618780 which is
independent of the workaround https://github.com/swiftlang/swift/pull/86745.

Once this is fixed, the workaround PR can be reverted.
2026-02-03 01:06:38 -05:00
Slava Pestov
389be8d927 Merge pull request #86864 from slavapestov/add-test-rdar169041434
Sema: Add regression test for fixed crasher
2026-02-03 02:33:26 +00:00
Hamish Knight
a0ca9409dd Merge pull request #86932 from hamishknight/fuzzy
[test] Add some more known crashers
2026-02-02 21:11:25 +00:00
Guillaume Lessard
ef9f489334 Merge pull request #86915 from glessard/gardening-dict-validation-test
[gardening] fix warnings in Dictionary validation test
2026-02-02 09:48:09 -08:00
Hamish Knight
eb8ead9264 [test] Add some more known crashers 2026-02-02 09:55:30 +00:00
Hamish Knight
87fa86fe47 [test] Update a couple of crasher signatures 2026-02-02 09:55:30 +00:00
Guillaume Lessard
a98b7388bb [test] fix warnings in Dictionary validation test 2026-01-30 22:21:33 -08:00
Ramon Asuncion
e79db11b89 [Test][BuildSystem] Prepend env to variable assignments for macOS-specific tests 2026-01-30 21:09:49 -05:00
Ramon Asuncion
d63edefcfe [Test][BuildSystem] Prepend env to variable assignments for internal shell 2026-01-30 20:39:10 -05:00
Hamish Knight
6453800b93 Merge pull request #85730 from hamishknight/wayfarer
[CS] Introduce Sendable-dependent functions
2026-01-29 19:42:37 +00:00
Slava Pestov
353972b4bb Sema: Add regression test for fixed crasher 2026-01-29 00:15:59 +00:00
Slava Pestov
b99e24e1d9 Sema: Minor improvements to performance tests
- Convert fast/rdar35213699.swift into a scale-test
- Add two new tests
2026-01-28 18:21:00 +00:00
Arnold Schwaighofer
6f7766b92a Merge pull request #86753 from aschwaighofer/coro_access_test
[CoroutineAccessors] Add SILGen and evolution test replacing underscored accessors by yielding accessors
2026-01-27 14:02:11 -08:00
eeckstein
9297de8d9e Merge pull request #86781 from eeckstein/fix-ownership-verifier
SIL: fix a complexity problem in the ownership verifier
2026-01-27 14:35:25 +01:00
Hamish Knight
a615b4cf02 [CS] Use Sendable dependence in adjustFunctionTypeForConcurrency
If the base captured type still has type variables when we bind the
member function type, form a Sendable dependent function type with
the base type. This will then be eliminated by TypeSimplifier once
all the type variables in the base type have been resolved.

This then allows us to remove the delaying logic from member lookup.
2026-01-27 11:06:54 +00:00
Slava Pestov
3f659d3085 Merge pull request #86687 from slavapestov/disjunction-selection-experiments-2
Sema: Disjunction pruning optimization
2026-01-27 10:51:59 +00:00
Erik Eckstein
4a1950d292 SIL: fix a complexity problem in the ownership verifier
Computing dominance relation between instructions in the same block was done with linear search, e.g. when checking if a value-use is before its lifetime ending instruction.
This resulted in quadratic complexity and very long compile times for very large basic blocks.
Now we do the dominance check with pre-computed instruction indices, which is O(0) instead of O(n).

https://github.com/swiftlang/swift/issues/86663
rdar://168511262
2026-01-27 08:56:13 +01:00
Rintaro Ishizaki
4ca8b02234 [Test] Temporarily disable a failing test case
rdar://168511262
2026-01-26 16:12:47 -08:00
Slava Pestov
95a54ce82a Sema: Yet another constraint optimization pass
- Fixes https://github.com/swiftlang/swift/issues/55762
- Fixes rdar://32034560
2026-01-26 21:48:59 +00:00
Slava Pestov
5f75b9a7a1 Remove unnecessary %s 2026-01-26 21:48:59 +00:00
Slava Pestov
787ea8d1b6 Sema: Add another performance test 2026-01-26 21:48:59 +00:00
Arnold Schwaighofer
d614ef9acc Fix verify-swift-feature-testing.test-sh -- the second attempt 2026-01-26 06:50:32 -08:00
Arnold Schwaighofer
e6c4d85c97 Fix/disable test on certain platforms 2026-01-24 16:23:49 -08:00
Hamish Knight
82f683f162 Merge pull request #86696 from hamishknight/too-many-vars
[SILGen] Fix AddressableBuffer's move operations
2026-01-24 14:16:09 +00:00
elsa
5e9f215f31 Merge pull request #86010 from elsakeirouz/rework-for-each-desugar
Rework ForEachStmt Desugaring
2026-01-24 13:55:51 +00:00
Slava Pestov
4d6ff92fba Sema: Add more fast and slow type checker performance test cases 2026-01-23 20:02:21 -05:00
Arnold Schwaighofer
83b3bfe19b [CoroutineAccessors] Add a before/after library evolution execution test for _read/modify -> yielding borrow/mutate 2026-01-23 13:44:03 -08:00
Elsa Keirouz
d54a572f7f [Sema] desugar ForEachStmt at AST level 2026-01-23 15:17:29 +00:00
Hamish Knight
4ac320ad83 [SILGen] Move insertPoint in AddressableBuffer's move constructor
Otherwise we'd lose it when the DenseMap storage gets resized.
2026-01-21 21:39:18 +00:00
Slava Pestov
e20a8fa0e6 Sema: Add new variant of operators_inside_closure.swift
Suggested by Pavel while debugging another issue. Don't want this one to
regress either.
2026-01-21 11:09:59 -05:00
Slava Pestov
1a57af43bd Merge pull request #86662 from slavapestov/simple-scale-tests
Sema: Add some scale-tests
2026-01-20 23:54:24 -05:00
Slava Pestov
1435d6a0f4 Sema: Add a scale-test for missing test coverage
There was an existing CSOptimizer heuristic which improved performance
in the case where && was overloaded, which we weren't testing in our
test suite.
2026-01-20 16:19:43 -05:00
Slava Pestov
6047de172f Sema: Add a pair of scale-tests
not1 is only fast on accident -- no disjunction scores are assigned,
because we do not consider result type matching when scoring
non-operator disjunctions. We should fix this!

not2 is fast because we do consider parameter types, so we score
disjunctions and solve the innermost one first.
2026-01-20 12:25:50 -05:00
Hamish Knight
8048f86b15 [AST] Avoid flattening type variable tuple singletons
If we have `(_: $T0)`, avoid flattening to `$T0` since for a pack
expansion type variable that would result in a bare pack type instead
of a tuple. Instead, leave the flattening for TypeSimplifier.
2026-01-19 23:37:56 +00:00
Hamish Knight
b231d90c68 [test] Add some more known crashers 2026-01-19 11:26:16 +00:00
Hamish Knight
cbff3d1e3e [test] Update a couple of crasher signatures 2026-01-19 11:26:15 +00:00
Hamish Knight
86b1128f7e [test] Quote paths in swift-dev-utils.test 2026-01-19 00:28:33 +00:00
Hamish Knight
af7a7247ad Merge pull request #86631 from hamishknight/monolith
[utils] Move `swift-xcodegen` to `swift-dev-utils`
2026-01-19 00:28:01 +00:00
Hamish Knight
b5d4c4c46d [utils] Move swift-xcodegen to swift-dev-utils
The goal here is for `swift-dev-utils` to be a monolithic package
for development utils written in Swift.
2026-01-18 19:25:51 +00:00