Commit Graph

21 Commits

Author SHA1 Message Date
Anthony Latsis
d98a76172d Gardening: Migrate test suite to GH issues: Sema (1/2) 2022-09-02 11:00:19 +03:00
Doug Gregor
e21a96f4ab [SIMD] Update tests to reflect the SIMD operators in the standard library
Introducing the SIMD operators back into the standard library regresses
one test (SR-139 goes exponential against without the designated types
for operatores feature). Split that part of the test out.
2018-12-17 11:43:45 -08:00
Stephen Canon
5b3b6bc40f Restore a complex_expressions test that we no longer need disabled. (#20924) 2018-11-30 18:23:45 -05:00
Stephen Canon
fb8b9e143d SIMD into stdlib
Implements SE-0229.

Also updates simd module types in the Apple SDKs to use the new types, and updates a couple tests to work with the new types and protocols.
2018-11-29 17:09:01 -05:00
Mark Lacey
37009b0d8b [ConstraintSystem] Remove constraint propagation.
The current implementation isn't really useful in the face of generic
overloads. It has never been enabled by default, and isn't useful to
keep around if it is disabled. If we ever want to bring it back,
we know where to look!
2018-02-12 21:30:39 -08:00
Pavel Yaskevich
8bf03b5c43 [ConstraintSolver] Add Component class as an isolated "solvable" unit
Move disjunction selection logic one level up from the `solveSimplified`
which allows to simplify its logic and avoid collecting disjunctions
multiple times for each solver step.

Sort constraint components/buckets based on how many disjunctions
they have, that helps to prune some of the branches with incorrect
solutions early which limits overall depth of the search.

Resolves: SR-4714
2017-08-28 13:39:29 -07:00
Pavel Yaskevich
00c0972d07 [QoI] Add test-case for rdar://problem/33806601 2017-08-09 11:52:31 -07:00
Pavel Yaskevich
fea7bcf232 [ConstraintSystem] Prevent shrink from solving "too complex" sub-expressions
Add additional checking for complexity of the shrinking candidate
given the number of the expressions solved so far and total number
of disjunctions present. This allows us to bail quicker in complex
expression cases which, at the very least, produces an error instead
of being "stuck" in solver for a long time.

Resolves: rdar://problem/32034560
2017-05-31 13:54:43 -07:00
Mark Lacey
21fd184e0d Disable an "expression too complex" test for now.
I've opened https://bugs.swift.org/browse/SR-4714 to track fixing the
slowness here and/or moving the test into the validation suite.

We're currently not "too complex" here given the current metric, but we
are still extremely slow, adding several minutes to test runs.
2017-04-26 14:57:04 -07:00
Max Moiseev
e35b3c957b Fixing the complex expression test 2017-04-17 10:24:29 -07:00
Mark Lacey
d28da64850 [Constraint solver] Disabling the shrink() pass results in new ambiguities.
One expression in this test becomes ambiguous when the shrink() pass is
disabled. Enabling the constraint propagation pass disables the shrink
pass.

For now we'll run this with -propagate-constraints explicitly enabled
and with the expected output changed. This is a regression that will
need to be investigated and fixed in the solver.
2017-04-15 20:18:09 -07:00
Colin Douglas Howell
fb235125fb [CSGen] Fix for exponential dictionary literal behavior in SR-3668
In ConstraintGenerator::visitDictionaryExpr(), if the dictionary_expr has a
contextual type which is also a dictionary type, use it to add a new type
constraint for each of the dictionary_expr's elements. This has a huge effect
on solver performance for dictionary literals with elements that have
overloading. The approach closely follows that used in
ConstraintGenerator::visitArrayExpr(), which has included a similar
optimization (from git commit a22b391) for over two and a half years.

I've also added a couple of new test cases which would trigger the bug without
this fix.
2017-01-21 23:47:01 -08:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
practicalswift
b19481f887 [gardening] Fix 67 recently introduced typos 2016-09-16 11:16:07 +02:00
Pavel Yaskevich
73318a2132 [Type Checker] Extend Path Consistency algorithm to cover collections
ExprCollector is extended to cover all generic collections instead of
only dictionary expressions. Contextual type propagation is extended
to support partial solving of collections embedded into coerce expressions.
2016-09-14 13:51:08 -07:00
Erik Eckstein
38cb48b29a Revert "[Type Checker] Extend Path Consistency algorithm to cover collections"
This reverts commit f590a1ba03.

It breaks this kind of code:

test.swift:2:34: error: cannot convert value of type 'Int' to expected element type 'UInt32'
 let lengthBytes: [UInt32] = [55 * 8, 0]
                              ~~~^~~
                              UInt32( )
2016-09-14 11:15:34 -07:00
Pavel Yaskevich
f590a1ba03 [Type Checker] Extend Path Consistency algorithm to cover collections
ExprCollector is extended to cover all generic collections instead of
only dictionary expressions. Contextual type propagation is extended
to support partial solving of collections embedded into coerce expressions.
2016-09-13 01:34:14 -07:00
Pavel Yaskevich
2011e502ad [Type Checker] Prevent Path Consistency algorithm from aborting too aggressively
Instead of failing shrinking when there are no solutions for current
sub-expression, let's restore overload domains for previously solved
sub-expressions and move on trying to solve next expression in the queue.
2016-08-26 17:21:04 -07:00
Pavel Yaskevich
8e04a84239 [Type checker] Introduce directional path consistency algorithm
DPC algorithm tries to solve individual sub-expressions and combine
resolved types as a way to reduce pre-existing OSR domains. Solving
is done bottom-up so each consecutive sub-expression tightens
possible solution domain even further.
2016-08-24 18:40:28 -07:00
Mishal Shah
a84704f4b5 Revert "[Type checker] Introduce directional path consistency algorithm" 2016-08-24 17:53:12 -07:00
Pavel Yaskevich
de51b01195 [Type checker] Introduce directional path consistency algorithm
DPC algoritm tries to solve individual sub-expressions and combine
resolved types as a way to reduce pre-existing OSR domains. Solving
is done bottom-up so each consecutive sub-expression tightens
possible solution domain even further.
2016-08-24 14:38:46 -07:00