Commit Graph

5 Commits

Author SHA1 Message Date
Stephen Canon
fddd8bd5b9 Mark the concrete SIMD/Scalar comparisons disfavored (#82686)
Adding the concrete versions (https://github.com/swiftlang/swift/pull/81892) introduced an ambiguity for concrete vec .<= .zero comparisons; previously the concrete SIMD .<= SIMD operation would win (because we didn't have a concrete overload for SIMD .<= SIMD.Scalar). We can restore the old behavior by marking these disfavored.
2025-07-02 11:59:07 -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
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