Commit Graph

5 Commits

Author SHA1 Message Date
Stephen Canon
bf558a376a Further relax concrete simd ir tests (#82242)
It turns out that on some targets we generate a call to initialize a
SIMD vector from a Builtin.Vec, even though everything is transparent,
so the checks for the return using a specific value were too fragile.

rdar://153260158
2025-06-16 20:16:05 -04:00
Stephen Canon
b67050b61d SIMD test IR not ASM (#82078) 2025-06-12 14:38:04 -07: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
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