Commit Graph

5277 Commits

Author SHA1 Message Date
Doug Gregor
8d5971e81e [Type checker] Be more careful when checking @_implements.
Fixes rdar://problem/46678653.
2019-01-04 20:22:34 -08:00
sarveshtamba
5b627632bc Changes for #SR-9413:Swift 5.0 test failures on PowerPC 2018-12-26 07:55:18 +00:00
Rintaro Ishizaki
22652f9e88 [Parse] Eliminate backtracking in collection expression parsing
Parsing collection literal expression used to take exponential time
depending on the nesting level of the first element.

Stop using 'parseList()' because using it complicates libSyntax parsing.

rdar://problem/45221238 / https://bugs.swift.org/browse/SR-9220
rdar://problem/38913395 / https://bugs.swift.org/browse/SR-7283
2018-12-25 11:05:23 +09:00
sarveshtamba
56318f3e1f Changes for #SR-9413:Swift 5.0 test failures on PowerPC 2018-12-24 11:37:38 +00:00
David Smith
4e4325d248 Merge pull request #21235 from Catfish-Man/cheaper-by-the-dozen
Adopt bulk Dictionary creation in bridging
2018-12-21 11:37:40 -08:00
David Smith
016ced2c44 Adopt the new bulk Dictionary initializer in bridging 2018-12-20 16:57:38 -08:00
Michael Gottesman
4b95ca82b9 Merge pull request #21439 from gottesmm/pr-8067c5675a42d8ecfc248e2b2fe644ee2795fc06
[ownership] Eliminate -assume-parsing-unqualified-ownership-sil now that it is a no-op.
2018-12-19 17:35:40 -08:00
Michael Ilseman
0ac802a95b Merge pull request #21310 from milseman/4_bit_string
[String] Last-minute ABI adjustment: 4-bit discriminator
2018-12-19 16:42:20 -08:00
Pavel Yaskevich
5aec222800 Merge pull request #21444 from xedin/rdar-46850561
[TypeChecker] NFC: Disable test-case rdar://26564101 to investigate w…
2018-12-19 16:34:38 -08:00
Pavel Yaskevich
a7f4ee3964 [TypeChecker] NFC: Disable test-case rdar://26564101 to investigate whether it's fast or slow
Resolves: rdar://problem/46850561
2018-12-19 14:00:52 -08:00
Michael Ilseman
5a6d2dfa59 [String] Switch ABI to only use 4 discriminator bits.
In anticipation of potential future HW features, e.g. armv8.5 memory
tagging, only use the high 4 bytes as discriminator bits in
_BridgeObject rather than the top 8 bits. Utilize two perf flags to
cover this instead. This requires shifting around a fair amount of
internal complexity.
2018-12-19 13:54:50 -08:00
Michael Gottesman
fd4828e40a Eliminate -assume-parsing-unqualified-ownership-sil from tests.
I am doing this separately from the actual change to eliminate the option to
make it easier to review.
2018-12-19 12:54:13 -08:00
Maxim Moiseev
1f5c0f8bd4 Fix PersistentVector prototype 2018-12-18 16:12:48 -08:00
Karoy Lorentey
f0e04f73f4 [stdlib] Process elements from back to front 2018-12-18 09:49:58 -08:00
Karoy Lorentey
039891c24b [stdlib] Dictionary: Add support for non-unique keys in bulk loading init 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f1f5e0f2bf [stdlib] Dictionary: Add unsafe bulk-loading initializer
Interface inspired by this Array pitch:
https://forums.swift.org/t/array-initializer-with-access-to-uninitialized-buffer/13689
2018-12-18 09:49:58 -08:00
Michael Gottesman
82de2b9468 Merge pull request #21401 from gottesmm/ossa_flag
[ownership] Use the SILFunction attribute [ossa] instead of the global flag -assume-parsing-unqualified-ownership-sil
2018-12-18 07:31:34 -08:00
Pavel Yaskevich
4cf741e9fb Merge pull request #21386 from xedin/mark-26564101-as-fast
[TypeChecker] Mark test-case for rdar://26564101 as fast
2018-12-18 01:00:21 -08:00
Michael Gottesman
40a09c9c21 Fixup tests for -assume-parsing-unqualified-ownership-sil => [ossa] transition. 2018-12-18 00:49:32 -08:00
Pavel Yaskevich
355390412e [TypeChecker] Mark test-case for rdar://26564101 as fast
Resolves: rdar://problem/46785202
2018-12-17 14:50:27 -08: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
Doug Gregor
69c9fbc3c8 Move SIMD operators back into the Swift standard library
Moving them out to SIMDOperators didn't help, but the type checker hack
might. Move them back into the Swift standard library where they belong,
but leave SIMDOperators there to smooth over any short-term
incompatibilities.
2018-12-17 11:07:32 -08:00
Slava Pestov
f06fae36d9 Sema: Change a performance test case to not build a one-element tuple 2018-12-15 00:07:04 -05:00
Mark Lacey
10ef7347a7 [ConstraintSystem] Better handling of operators with multiple designated types.
For operators with multiple designated types, we attempt to decide the
best order for exploring the types. We were doing this by checking
for matching types. Extend this to also consider conforming types.

Fixes: rdar://problem/46687985
2018-12-14 13:24:23 -08:00
Pavel Yaskevich
4f25c55723 Merge pull request #21317 from xedin/rdar-46497155
[CSDiag] Account for expression sanitizer mutating AST
2018-12-14 11:08:05 -08:00
Pavel Yaskevich
5239edfc99 [TypeChecker] Add a test-case for rdar://problem/46497155 2018-12-13 21:14:53 -08:00
Karoy Lorentey
c8664c490d [test] Dictionary: Add checks for expected failures in Dictionary bridging 2018-12-13 17:09:36 +00:00
Arnold Schwaighofer
c711181f83 Merge pull request #21256 from aschwaighofer/irgen_conditionally_test_weak_enum_cases
IRGen: Conditionally test weakly linked enum cases
2018-12-13 08:06:47 -08:00
Doug Gregor
aa506289a3 Merge pull request #21231 from DougGregor/simd-operator-type-check-perf-hack
[Constraint solver] De-prioritize SIMD operators.
2018-12-12 20:15:21 -08:00
swift-ci
bb443c6ed5 Merge pull request #21233 from brentdax/thats-this-diagnostic-sorted 2018-12-12 14:59:02 -08:00
Brent Royal-Gordon
eb81efe369 Update two diagnostics in validation tests 2018-12-12 13:01:38 -08:00
swift-ci
f453092465 Merge pull request #21152 from compnerd/library-prefix-suffix 2018-12-12 12:45:21 -08:00
Arnold Schwaighofer
5ae00ee2a2 IRGen: Conditionally test weakly linked enum cases
rdar://46438568
2018-12-12 11:18:12 -08:00
Arnold Schwaighofer
fe1b75fe73 Merge pull request #21223 from aschwaighofer/irgen_dont_hoist_weakly_linked_types
IRGen: Don't hoist metadata for weakly linked types
2018-12-12 11:09:42 -08:00
Jordan Rose
4017416d5e [Serialization] Only allow loading modules during import resolution (#21218)
Very early groundwork for private imports. Should not affect anything
today.
2018-12-12 10:50:20 -08:00
Michael Ilseman
647c60b6b1 Merge pull request #21217 from milseman/test_if_contiguous
[test] Test String.UTF8View.withContiguousStorageIfAvailable
2018-12-12 10:44:32 -08:00
Saleem Abdulrasool
8968fcad5f test: create and use target-library-name 2018-12-12 08:37:59 -08:00
Arnold Schwaighofer
0c01906218 Address review feedback 2018-12-12 08:22:09 -08:00
John McCall
2ba7090fe8 Remove the extra-inhabitant value witness functions.
This is essentially a long-belated follow-up to Arnold's #12606.
The key observation here is that the enum-tag-single-payload witnesses
are strictly more powerful than the XI witnesses: you can simulate
the XI witnesses by using an extra case count that's <= the XI count.
Of course the result is less efficient than the XI witnesses, but
that's less important than overall code size, and we can work on
fast-paths for that.

The extra inhabitant count is stored in a 32-bit field (always present)
following the ValueWitnessFlags, which now occupy a fixed 32 bits.
This inflates non-XI VWTs on 32-bit targets by a word, but the net effect
on XI VWTs is to shrink them by two words, which is likely to be the
more important change.  Also, being able to access the XI count directly
should be a nice win.
2018-12-11 22:18:44 -05:00
Doug Gregor
88d34a1c7c [Constraint solver] De-priority SIMD operators.
The new SIMD proposal introduced a number of new operators, the presence of
which causes more "expression too complex" failures. Route around the
problem by de-prioritizing those operators, visiting them only if no
other operator could be chosen. This should limit the type checker
performance cost of said operators to only those expressions that need
them OR that already failed to type-check.

Fixes rdar://problem/46541800.
2018-12-11 16:34:37 -08:00
Saleem Abdulrasool
b212229db1 test: add and use prefix substitutions for libraries
The naming convention is different on Windows than on Unix-like
environments.  In order to follow the convention we need to substitute
the prefix and the suffix.  Take the opportunity to rename the
`target-dylib-extension` to the CMake-like variable
`target-shared-library-suffix` and introduce
`target-shared-library-prefix`.  This helps linking the test suite
binaries on Windows.
2018-12-11 15:56:06 -08:00
Slava Pestov
4c0b391537 Sema: Ensure that even invalid extensions still have a generic parameter list
This helps maintain invariants, such as the presence of a generic
parameter list implying the presence of a generic signature.

Fixes <rdar://problem/45317855>.
2018-12-11 17:48:52 -05:00
Arnold Schwaighofer
2f34bdcbbc IRGen: Don't hoist metadata for weakly linked types
rdar://46438608
2018-12-11 13:15:33 -08:00
Michael Ilseman
d6bee746ff [test] Test String.UTF8View.withContiguousStorageIfAvailable 2018-12-11 11:57:05 -08:00
eeckstein
7732b984bd Merge pull request #21172 from eeckstein/silcombine-enums
SILCombine: peephole to propagate resilient enum cases
2018-12-11 08:21:28 -08:00
Jason Mittertreiner
4e0b092fbe Fixing Driver tests on Windows (#20209) 2018-12-10 18:27:37 -08:00
Erik Eckstein
5c17f0f6f8 SILCombine: peephole to propagate resilient enum cases
Basically the pattern to optimize is:
    inject_enum_addr %stackloc, #SomeCase
    switch_enum_addr %stackloc ...

This works even if the enum is resilient and the case does not have a payload. As long as we don't have opaque values in SIL we need this peephole to optimize the pattern.
This change fixes the code generation for Float.rounded().

rdar://problem/46353885
2018-12-10 16:14:15 -08:00
Slava Pestov
f5eb7087aa Add a couple of regression tests 2018-12-10 00:00:49 -05:00
Ben Cohen
11769d2494 Add tests for withContiguousStorageIfAvailable 2018-12-07 17:30:13 -08:00
Ben Cohen
ad50a39b12 [stdlib] Add withContiguous{Mutable}StorageIfAvailable (#21092)
* Add MutableCollection.withContiguousMutableStorageIfAvailable

* Add withContiguousMutableStorageIfAvailable impls

* Add tests on concrete types

* Add Sequence.withContiguousStorageIfAvailable

* Implement withContiguousStorageIfAvailable in concrete types
2018-12-07 10:01:18 -08:00