Commit Graph

7802 Commits

Author SHA1 Message Date
(null)
aaf283258b Merge branch 'main' into mchiu/freebsd 2025-06-17 15:41:57 -04:00
(null)
d6811260a9 Merge commit '665515c781999a81094bbe4f8302a7cb1a6a6b39' into mchiu/freebsd 2025-06-17 15:12:23 -04:00
Guillaume Lessard
e29b425a6b Merge pull request #82277 from glessard/rdar153219174-UMBP-mutableSpan
[stdlib] add missing computed properties
2025-06-17 11:51:06 -07:00
Valeriy Van
61ab279986 Fix doc comment in DropWhile.swift (#82290) 2025-06-17 10:38:02 -07:00
Guillaume Lessard
0433cd292c [stdlib] add UMBP.mutableSpan accessor 2025-06-16 22:28:21 -07:00
Guillaume Lessard
f952ca5988 [stdlib] add URMBP.mutableBytes accessor 2025-06-16 22:28:21 -07:00
Guillaume Lessard
3b9ec94f20 Merge pull request #82102 from valeriyvan/span
Fix parameter, doc comments in Span family
2025-06-12 04:41:50 -07:00
Susana Monteiro
6164af2f46 Merge pull request #81832 from swiftlang/susmonteiro/class-metadata-private-fields
[cxx-interop] Support for printing C++ foreign references
2025-06-11 11:58:45 +01:00
susmonteiro
848fad0021 [cxx-interop] Support for printing C++ foreign references 2025-06-10 12:15:21 +01:00
Valeriy Van
b1082d400f Update stdlib/public/core/Span/RawSpan.swift
Co-authored-by: Guillaume Lessard <glessard@tffenterprises.com>
2025-06-09 20:14:46 +03:00
Valeriy Van
e49050a42a Update stdlib/public/core/Span/RawSpan.swift
Co-authored-by: Guillaume Lessard <glessard@tffenterprises.com>
2025-06-09 20:14:25 +03:00
Valeriy Van
83d3d4b3cb Fix doc comment 2025-06-09 18:01:36 +03:00
Valeriy Van
1c0306871c Revert "Rename parameter count => byteCount to make signature match doc comment and match other methods"
This reverts commit 4129383ba7.
2025-06-09 17:59:13 +03:00
Valeriy Van
43ead66f42 Fix doc comment 2025-06-09 11:56:45 +03:00
Valeriy Van
4129383ba7 Rename parameter count => byteCount to make signature match doc comment and match other methods 2025-06-09 11:56:06 +03:00
Valeriy Van
505d55c4d1 Add type parameter to make code match doc comment 2025-06-09 11:54:44 +03:00
Guillaume Lessard
2afb6b5012 Merge pull request #82077 from glessard/issue81931
[stdlib] fix utf8Span accessors for small strings
2025-06-08 03:10:15 -07:00
Valeriy Van
c14699310f Fix typo (#82052) 2025-06-07 23:16:43 -04:00
Guillaume Lessard
c7324389d9 [stdlib] fix small string usage for Substring.utf8Span 2025-06-07 07:48:33 -07:00
Guillaume Lessard
83edacbcc6 [stdlib] fix small-string usage for String.utf8Span 2025-06-07 07:48:33 -07:00
Jamie
f7560c0189 [docs][NFC]: minor formatting edits to SendableMetatype docs 2025-06-06 21:38:48 -05:00
Guillaume Lessard
d38b961cb7 Merge pull request #82013 from glessard/rdar152615917-addressable-string-types
[stdlib] adjust addressable attribute on String type family
2025-06-06 16:55:57 -07:00
Guillaume Lessard
9e8019a0fe [stdlib] make annotation adjustments 2025-06-06 08:21:48 -07:00
Doug Gregor
89628ab2ec Merge pull request #82040 from DougGregor/sendable-metatype-docs 2025-06-06 08:04:32 -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
Doug Gregor
55d5de6218 Fix more typos 2025-06-05 18:10:43 -07:00
Doug Gregor
a5554a4840 Fix typos 2025-06-05 18:10:01 -07:00
Doug Gregor
9ab0c57ee9 Improve SendableMetatype documentation 2025-06-05 16:53:55 -07: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
a59a6cae58 [stdlib] Add a transparent specialization of ~= for Range
Making the generic ~= transparent does not help unoptimized code; adding a specialization does.
2025-06-04 17:02:51 -07:00
Karoy Lorentey
7cd41df5ce [stdlib] Make PartialRangeFrom.contains transparent
Kudos to @benrimmington for spotting this
2025-06-04 17:02:49 -07:00
Karoy Lorentey
d231213987 [stdlib] On second thought, making ClosedRange.contains(Range) transparent is a bad idea 2025-06-04 17:02:48 -07:00
Karoy Lorentey
7a5dbef390 [stdlib] Mark contains methods on Range/ClosedRange transparent
These are really popular shorthands for implementing bounds checks, but currently they aren’t even marked `@inline(__always)`, so in larger functions they tend to remain outlined, defeating optimizations that would otherwise happen.

The corresponding variants on the partial range types are `@_transparent`; that helps unoptimized performance, so let’s apply the same attribute here.

rdar://151177326
2025-06-04 17:02:45 -07:00
Alastair Houghton
42ca1b1cc8 Rename SwiftStdlibCurrentOS to StdlibDeploymentTarget.
`StdlibDeploymentTarget` seems to be a better name.

rdar://152498657
2025-06-04 10:40:19 +01:00
Alastair Houghton
d5ed335339 Merge pull request #81440 from al45tair/currentos-availability
[Concurrency][Stdlib] Add SwiftStdlibCurrentOS availability, use it.
2025-06-03 15:01:22 +01:00
Michael Chiu
84ee0af416 CLongDouble should map to Float128 (which is yet supported) on arm64, and trivial copy ctor is yet available even on 14 2025-06-02 13:39:50 -04: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
Guillaume Lessard
653d0e9601 Merge pull request #81816 from glessard/rdar138440979-mutablespan-abi-fix
[stdlib] fix an extraneous symbol exported by MutableSpan
2025-05-30 02:23:44 -07:00
michael-yuji
8738e722bd Merge branch 'main' into mchiu/freebsd 2025-05-28 14:44:11 -07:00
Guillaume Lessard
3d70e6087d [stdlib] fix an extraneous symbol exported by MutableSpan 2025-05-28 13:32:21 -07:00
eeckstein
89bdb311ab Merge pull request #81780 from eeckstein/optimize-enum-comparison
Optimize enum comparisons
2025-05-28 07:01:29 +02: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
Erik Eckstein
cac594fb86 Optimizer: peephole optimization for raw-value enum comparsions
Optimize (the very inefficient) RawRepresentable comparison function call to a simple compare of enum tags.
For example,
```
  enum E: String {
    case  a, b, c
  }
```
is compared by getting the raw values of both operands and doing a string compare.
This peephole optimizations replaces the call to such a comparison function with a direct compare of the enum tags, which boils down to a single integer comparison instruction.

rdar://151788987
2025-05-27 12:11:03 +02:00
Karoy Lorentey
a7830d754a Merge pull request #80870 from lorentey/stdlib-version-6.3
[stdlib][runtime] Establish Swift Stdlib/runtime version 6.3
2025-05-21 17:48:22 -07:00
michael-yuji
9a948a9c3b Merge branch 'main' into mchiu/freebsd 2025-05-21 16:29:16 -07:00
Allan Shortlidge
f8fb99320a Embedded: Suppress spurious unused result warnings.
The results of `swift_retain(object:)` and `swift_bridgeObjectRetain(object:)`
should be discardable since it's typcial to not need the pointer returned from
these calls. Suppresses unused result warnings that were generated previously.
2025-05-18 10:40:13 -07:00
Karoy Lorentey
d98002318d [stdlib][runtime] Establish Swift Stdlib/runtime version 6.3 2025-05-16 19:01:32 -07:00