Commit Graph

3290 Commits

Author SHA1 Message Date
Evan Wilde
b2d34ceea2 Merge pull request #82113 from etcwilde/ewilde/fedora-41-symbols
Add missing symbols for Fedora41
2025-06-10 11:32:41 -07:00
Stephen Canon
c30fc23013 Stop testing FP16 assembly codegen for now (#82045)
Older iOS / watchOS targets do not default to having armv8.2 FP16 enabled, so FileCheck was failing when building for those because we didn't have the "right" assembly pattern. Stop testing Float16 compare codegen for now. I'll restore it with an IR test instead of assembly.

Resolves <rdar://152418752>
2025-06-09 13:35:09 -04:00
Evan Wilde
66a4e52a87 Add missing symbols for Fedora41
Fixing the linux symbol check to unblock nightly packages.
2025-06-09 09:33:53 -07:00
Guillaume Lessard
694e94b360 [test] remove repetitions 2025-06-07 07:48:34 -07:00
Guillaume Lessard
8a2ff96521 [test] UTF8Span from inline-stored Substring instances 2025-06-07 07:48:33 -07:00
Guillaume Lessard
bc59aedc3f [test] UTF8Span from inline-stored String instances 2025-06-07 07:48:33 -07:00
Guillaume Lessard
3a96d085c7 Merge pull request #82064 from glessard/generalize-expectNotNil
[stdlibUnittest] generalize `expectNotNil(_:)`
2025-06-06 22:04:59 -07:00
Guillaume Lessard
5895077382 [stdlibUnittest] generalize expectNotNil(_:)
Generalizes it for non-copyable and non-escapable values.
2025-06-06 09:14:27 -07:00
Karoy Lorentey
e47397730b Merge pull request #81458 from lorentey/range-contains-perf
[stdlib] Mark `contains` methods on `Range/ClosedRange` transparent
2025-06-06 04:12:18 -07:00
Karoy Lorentey
ff3cf98a2d [stdlib] ClosedRange.contains: Leave this force-inlined, not transparent
Making it transparent evidently induces new retain/release traffic in Array’s subscript, even though I can find no indication that `ClosedRange.contains` is ever called by that code path. Oh well.
2025-06-05 19:42:20 -07:00
Mykola (Nickolas) Pokhylets
87e536ebec Merge pull request #80440 from nickolas-pohilets/mpokhylets/weak-let 2025-06-05 09:59:33 +02:00
Karoy Lorentey
487bacabc0 [stdlib] Delete transparent ~= overload; mark the regular one always-inlined instead
The new overload messes up diagnostics too much.
2025-06-04 17:02:54 -07:00
Karoy Lorentey
a6ae23d472 [test] Add rudimentary test for transparent bounds checking helpers 2025-06-04 17:02:53 -07:00
Karoy Lorentey
0826ac6067 [test] Verify that [Closed]Range.contains and Range.~= get inlined even in unoptimized builds 2025-06-04 17:02:52 -07:00
Pavel Yaskevich
b189b8a320 Merge pull request #81936 from xedin/improve-optional-wrappedValue-mismatch-diagnostics
[CSSimplify] Fix `matchDeepEqualityTypes` to allow fixing of optionals
2025-06-03 09:19:50 -07:00
Pavel Yaskevich
4132aa04f9 [Tests] NFC: Update all of the test-cases improved by changes to generic argument mismatch handling 2025-06-03 00:49:06 -07:00
Michael Chiu
7bbafc599d Merge branch 'main' into mchiu/freebsd 2025-06-02 13:33:18 -04:00
Stephen Canon
d49dd182ed Simd float concrete comparisons (#81892)
There's no reason for these to ever be calls, so they should be
transparent instead of just aEIC. Also adds concrete versions of
comparisons with scalars, and filecheck tests to make sure these
generate 1-2 instruction sequences in release on arm64 (x86_64 is a
little trickier to test due to frame pointers, but if we get the right
codgen on arm64, in practice we do well on x86_64 for these too).

Also makes filecheck patterns for repeating initializers a bit more
robust.
2025-06-01 20:35:15 -07:00
Stephen Canon
4007e445c5 Add doc comments for some concrete SIMD overloads. (#81890)
Also removed concrete SIMDMask(lowHalf:highHalf:) init, as there is no
corresponding generic operation; it was added in error.
2025-06-01 09:20:25 -04:00
Daniil Kovalev
bcc7ed94a6 [AutoDiff] Define derivative for concrete SIMD.init(repeating:) (#81864)
The PR #81766 introduced some concrete SIMD operations, but
`init(repeating:)` was temporarily disabled due to differentiation
testing break. See:


7a00619065

This PR contains two changes:

1. Define custom derivatives for concrete `init(repeating:)` so we do
not fall into non-differentiability error diagnostic.

2. Add a fix to SIL linker so differentiability witness lookup is done
when the original function has both `@_alwaysEmitIntoClient` and
`@_transparent`. Similar changes were introduced previously in #78908,
but they only handled `@_alwaysEmitIntoClient` without `@_transparent`.

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->
2025-05-30 20:10:29 -07:00
Pavel Yaskevich
ded6158cc3 [CSSimplify] Detect when generic argument mismatch applies to argument and produce a tailed fix
The problem detection logic currently expects `generic argument #<N>`
location to always be associated with two generic types, but that
is not always the case, this locator element is sometimes used for
i.e. optional object types and pointer `Pointee` type when types
appear in argument positions. This needs to be handled specifically.

Resolves: rdar://82971941
2025-05-30 09:52:57 -07:00
michael-yuji
8738e722bd Merge branch 'main' into mchiu/freebsd 2025-05-28 14:44:11 -07:00
Stephen Canon
592d72bba9 Concrete SIMD.init(repeating:) and SIMD.init(lowHalf:highHalf:) optimizations (#81766)
WIP to add more overloads to optimize SIMD codegen on concrete types.
Here we do:

- init(repeating:)
- init(lowHalf:highHalf:)

These are always inlined, even in debug, since LLVM knows how to lower
them to one or two instructions on the targets that we care about.
2025-05-27 15:15:13 -04:00
Mykola Pokhylets
de3a87c0ab Merge branch 'main' into mpokhylets/weak-let 2025-05-23 17:26:49 +02:00
michael-yuji
9a948a9c3b Merge branch 'main' into mchiu/freebsd 2025-05-21 16:29:16 -07:00
eeckstein
d985bf6435 Merge pull request #81567 from eeckstein/fix-builtin-emplace
SILGen: insert an `end_lifetime` in the throw-branch of a `Builtin.emplace`
2025-05-17 23:40:25 +02:00
finagolfin
35ee368bb9 [android][test] Fix or disable the remaining failing tests on the Android CI (#81398)
Also, fix and enable `IRGen/lto_autolink` for all non-Wasm targets and
`IRGen/static_initializer` for aarch64.


This should get [the community Android
CI](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-build/)
green
[again](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-arm64/).
2025-05-17 13:27:33 +05:30
Erik Eckstein
ddbc3a2fad SILGen: insert an end_lifetime in the throw-branch of a Builtin.emplace
When the called closure throws an error, it needs to clean up the buffer.
This means that the buffer is uninitialized at this point.

We need an `end_lifetime` so that the move-only checker doesn't insert a wrong `destroy_addr` because it thinks that the buffer is initialized.

Fixes a mis-compile.

rdar://151461109
2025-05-16 21:54:39 +02:00
Mykola Pokhylets
3e0de8672a Removed the feature and made changes unconditional 2025-05-15 10:52:09 +02:00
Mykola Pokhylets
5a69c8ebdb Added REQUIRES: swift_feature_WeakLet 2025-05-15 10:26:27 +02:00
Mykola Pokhylets
8c37d25db9 Added tests for let properties to Mirror 2025-05-15 10:26:27 +02:00
Slava Pestov
70b413dc56 RemoteInspection: Support for parameter packs 2025-05-09 14:49:37 -04:00
Nate Cook
e68069f891 [stdlib] Allow a default for optional interpolations (#80547)
This adds an `appendInterpolation` overload to
`DefaultStringInterpolation` that includes a parameter for providing a
default string when the value to interpolate is `nil`. This allows this
kind of usage:

```swift
let age: Int? = nil
print("Your age is \(age, default: "timeless")")
// Prints "Your age is timeless"
```

The change includes an additional fixit when optional values are
interpolated, with a suggestion to use this `default:` parameter.
2025-05-07 12:47:02 -05:00
Stephen Canon
ab2b28cc4b Add static .nanoseconds(_: Double) to Duration (#81210)
SE-0329 defines the following static factory methods:
```
public static func seconds<T: BinaryInteger>(_ seconds: T) -> Duration
public static func seconds(_ seconds: Double) -> Duration
public static func milliseconds<T: BinaryInteger>(_ milliseconds: T) -> Duration
public static func milliseconds(_ milliseconds: Double) -> Duration
public static func microseconds<T: BinaryInteger>(_ microseconds: T) -> Duration
public static func microseconds(_ microseconds: Double) -> Duration
public static func nanoseconds<T: BinaryInteger>(_ value: T) -> Duration
```
For no good reason, the obvious additional method:
```
public static func nanoseconds(_ nanoseconds: Double) -> Duration
```
was omitted. After talking this through with the LSG, we have decided
that this is simply a bug, and we will add this method without formal
evolution review.
2025-05-01 15:50:17 -04:00
Guillaume Lessard
594f46c47c Merge pull request #81170 from glessard/rdar150282203-false-positive-test-failure
[test] eliminate the possibility of a false positive
2025-04-30 12:28:33 -07:00
Guillaume Lessard
8f1ab06841 [test] eliminate the possibility of a false positive 2025-04-29 10:22:27 -07:00
Anthony
c9b17383c8 Grammatical corrections for compound modifiers 2025-04-24 09:21:32 +02:00
Guillaume Lessard
493e853039 Merge pull request #80684 from glessard/rdar137710901-addressable-utf8view-span
[SE-0456] enable span properties for the small-String representation
2025-04-17 22:52:14 -07:00
Guillaume Lessard
f349282dff [test] adjust test values 2025-04-14 14:26:01 -07:00
Guillaume Lessard
f8d62d52d9 [test] remove an unnecessary feature flag 2025-04-14 10:48:42 -07:00
Guillaume Lessard
2d50c6cce9 Revert "[temporary] disable small-string support"
This reverts commit ea44ff9fc9.
2025-04-14 10:48:42 -07:00
Guillaume Lessard
1f93566d69 Merge pull request #80517 from glessard/rdar138440979-MutableSpan-mutableBytes
[SE-0467] add mutableBytes to MutableSpan
2025-04-13 10:33:09 -07:00
Michael Ilseman
e6e4bd6056 UTF8Span (#78531)
Add support for UTF8Span

Also, refactor validation and grapheme breaking
2025-04-11 16:11:11 -06:00
Guillaume Lessard
e618f79691 [test] MutableSpan.mutableBytes property 2025-04-10 10:31:05 -07:00
Guillaume Lessard
5c54e3aea5 Merge pull request #80257 from glessard/rdar137710901-addressable-span-properties
[SE-0456, -0467] enable span properties for inline-storage types
2025-04-09 19:51:46 -07:00
Guillaume Lessard
f931d296a2 [stdlib] add InlineArray.mutableSpan 2025-04-09 09:56:06 -07:00
Guillaume Lessard
b90a6fcb41 [stdlib] add CollectionOfOne.mutableSpan 2025-04-09 09:56:06 -07:00
Mike Ash
6e70bef297 Merge pull request #80607 from mikeash/fix-varargs-test2
[Test] Correctly gate new VarArgs test on new runtime.
2025-04-08 09:45:53 -04:00
Philippe Hausler
9d1d917091 [Observation] ensure event triggers on deinitialization passes as if all properties that are being observed have changed (for weak storage) (#79823)
* [Observation] ensure event triggers on deinitialziation passes as if all properties that are being observed have changed (for weak storage)

* Add missing deinitialize method for synthetically triggering willSet

* Correct the weak location for tests

* Correct the test to actually test the deinitialization willSet trigger instead of testing weak value deinitialization time

* Refine the tests for deinit triggers to more tightly trigger deinitialization and weak references

* Correct missing trailing closure on deinit replacement

* Ensure all potential ids are triggered at the deinitialization edge trigger
2025-04-07 13:03:56 -07:00
Mike Ash
b2f1b44b95 [Test] Correctly gate new VarArgs test on new runtime.
The empty-arguments test fails when run against an older runtime, so don't test it there.

I tried to do this before, but got the condition backwards.

rdar://146839898
2025-04-07 14:53:00 -04:00