Commit Graph

6583 Commits

Author SHA1 Message Date
swift-ci
33c663ec14 Merge remote-tracking branch 'origin/main' into rebranch 2024-09-01 15:14:16 -07:00
Slava Pestov
44dbebdd9e Merge pull request #76200 from slavapestov/type-subst-invariant
AST: Type substitution can skip subtrees that won't change
2024-09-01 17:55:11 -04:00
swift-ci
2a4096acc0 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-30 13:20:41 -07:00
nate-chandler
b3fd194e56 Merge pull request #76095 from nate-chandler/lifetime-completion/20240826/1
[LifetimeCompletion] Avoid instruction list walk.
2024-08-30 12:35:06 -07:00
Slava Pestov
e79763b590 AST: Factor out mapLocalArchetypesOutOfContext() utility function 2024-08-30 15:24:00 -04:00
Slava Pestov
52ce02eb96 AST: Remove ArchetypeType::getRoot() 2024-08-30 15:24:00 -04:00
swift-ci
4f23900c42 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-29 17:54:08 -07:00
Slava Pestov
d36dcea88d Merge pull request #76154 from slavapestov/combine-substitution-maps
Move combineSubstitutionMaps() to SILOptimizer and fix an assertion
2024-08-29 20:51:49 -04:00
swift-ci
2e0988b17a Merge remote-tracking branch 'origin/main' into rebranch 2024-08-29 15:14:48 -07:00
Slava Pestov
b68a78cd54 SIL: Track local environments instead of root local archetypes 2024-08-29 16:18:13 -04:00
Allan Shortlidge
789b795cec SILOptimizer: Allow inlining of transparent functions in @backDeployed thunks.
In order for availability checks in iOS apps to be evaluated correctly when
running on macOS, the application binary must call a copy of
`_stdlib_isOSVersionAtLeast_AEIC()` that was emitted into the app, instead of
calling the `_stdlib_isOSVersionAtLeast()` function provided by the standard
library. This is because the call to the underlying compiler-rt function
`__isPlatformVersionAtLeast()` must be given the correct platform identifier
argument; if the call is not emitted into the client, then the macOS platform
identifier is used and the iOS version number will be mistakenly interpreted as
a macOS version number at runtime.

The `_stdlib_isOSVersionAtLeast()` function in the standard library is marked
`@_transparent` on iOS so that its call to `_stdlib_isOSVersionAtLeast_AEIC()`
is always inlined into the client. This works for the code generated by normal
`if #available` checks, but for the `@backDeployed` function thunks, the calls
to `_stdlib_isOSVersionAtLeast()` were not being inlined and that was causing
calls to `@backDeployed` functions to crash in iOS apps running on macOS since
their availability checks were being misevaluated.

The SIL optimizer has a heuristic which inhibits mandatory inlining in
functions that are classified as thunks, in order to save code size. This
heuristic needs to be relaxed in `@backDeployed` thunks, so that mandatory
inlining of `_stdlib_isOSVersionAtLeast()` can behave as expected. The change
should be safe since the only `@_transparent` function a `@backDeployed` thunk
is ever expected to call is `_stdlib_isOSVersionAtLeast()`.

Resolves rdar://134793410.
2024-08-29 08:43:07 -07:00
Mykola Pokhylets
e0ad7bde82 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/AST/ASTPrinter.cpp
#	lib/AST/FeatureSet.cpp
2024-08-29 11:28:43 +02:00
swift-ci
cb27c2a61c Merge remote-tracking branch 'origin/main' into rebranch 2024-08-26 21:35:11 -07:00
Nate Chandler
86cd9603da [PrunedLiveness] Add lower detail boundary.
To enable those clients which care only about _blocks_ whose
instructions or dead-defs make up the liveness boundary to avoid
iterating instruction lists, enhance boundary computation with a second
type (`PrunedLivenessBlockBoundary`) and migrate some methods from
liveness onto the boundary types to enable dispatching on the boundary
type to do only the amount of analysis that's necessary.
2024-08-26 16:04:57 -07:00
Nate Chandler
84b186ee79 [Gardening] Detypo'd. 2024-08-26 15:20:16 -07:00
Nate Chandler
c421537648 [NFC] PrunedLiveness: Allow user visitation.
PrunedLiveness records users and their lifetime-ending-ness.  Make this
available to clients by way of a visitor.
2024-08-26 15:16:36 -07:00
Erik Eckstein
c8e74b8393 Generic specialization: change the mangling for dropped metatype arguments
Instead of adding a "flag" (`m` in `...Tgm5`) make it more generic to allow to drop any unused argument.
Add all dropped arguments with a `t<n-1>` (where `<n-1>` is empty for n === 0). For example `...Ttt2g5`.
2024-08-26 10:43:15 +02:00
swift-ci
5567d948a7 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-25 05:15:06 -07:00
Michael Gottesman
00519669af Merge pull request #76076 from gottesmm/rdar134623227
[region-isolation] Treat sending indirect_results as disconnected even if it is a return value of an actor isolated function.
2024-08-25 08:02:25 -04:00
swift-ci
d1f642c28f Merge remote-tracking branch 'origin/main' into rebranch 2024-08-24 19:34:29 -07:00
Michael Gottesman
da597be76d Merge pull request #76075 from gottesmm/rdar133531625
[region-isolation] Treat as Sendable values that are meant to be ignored since they are marked with preconcurrency
2024-08-24 22:26:00 -04:00
swift-ci
ee0d59cc91 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-24 12:35:16 -07:00
Slava Pestov
8315120eaf Merge pull request #76051 from slavapestov/archetype-get-parent
AST: Remove ArchetypeType::getParent()
2024-08-24 15:31:01 -04:00
Michael Gottesman
3e27bfc03b [region-isolation] Treat sending indirect_results as disconnected even if it is a return value of an actor isolated function.
rdar://134623227
2024-08-24 14:02:41 -04:00
Michael Gottesman
49eee05647 [region-isolation] Treat as Sendable values that are meant to be ignored since they are marked with preconcurrency
rdar://133531625
2024-08-24 13:14:39 -04:00
Slava Pestov
cf784f980e AST: Remove SubstFlags::AllowLoweredTypes 2024-08-23 13:14:05 -04:00
Slava Pestov
da4d076f02 AST: Introduce SubstFlags::SubstitutePrimaryArchetypes 2024-08-22 18:41:14 -04:00
Slava Pestov
63028be348 SILCloner: Redo local archetype remapping 2024-08-22 17:17:53 -04:00
swift-ci
1b56b27c3b Merge remote-tracking branch 'origin/main' into rebranch 2024-08-22 12:34:33 -07:00
Erik Eckstein
c96b196ffa SwiftCompilerSources: bridge SILLinkage
Make SILLInkage available in SIL as `SIL.Linkage`.
Also, rename the misleading Function and GlobalVariable ABI `isAvailableExternally` to `isDefinedExternally`
2024-08-22 08:56:27 +02:00
swift-ci
e27edcada1 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-21 16:49:14 -07:00
Slava Pestov
39b4bda1dc AST: Introduce SubstFlags::SubstituteLocalArchetypes 2024-08-21 14:23:37 -04:00
Slava Pestov
ae77d6f0c1 AST: Replace one-off predicates with SubstitutionMap::getRecursiveProperties() 2024-08-21 13:19:10 -04:00
swift-ci
1450e0889d Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 19:16:30 -07:00
swift-ci
b08f7a1307 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 13:58:19 -07:00
Slava Pestov
5577f27661 AST: Opened existential environments store outer substitutions 2024-08-20 16:54:51 -04:00
Slava Pestov
0c2f28fd3d AST: Remove GenericSignature parameter from OpenedArchetypeType::get() 2024-08-20 12:15:27 -04:00
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
swift-ci
37c12030dc Merge remote-tracking branch 'origin/main' into rebranch 2024-08-14 14:56:32 -07:00
Augusto Noronha
00cac25f46 Merge pull request #75847 from augusto2112/keep-unused-getter
Eagerly emit getters at Onone.
2024-08-14 14:48:36 -07:00
Augusto Noronha
ae98212c1a Eagerly emit getters at Onone.
Force SILGen to also eagerly emit getters when compiling at Onone.
The reason for this is that getters (even not user-written ones,
generated by result builders) can, and are often called by users
debugging swift programs, and should be available for that reason.

rdar://133329303
2024-08-13 14:53:41 -07:00
swift-ci
6cd717acec Merge remote-tracking branch 'origin/main' into rebranch 2024-08-12 10:35:39 -07:00
Erik Eckstein
32b53f8bcb DeinitDevirtualizer: fix an assert crash when creating an alloc_stack 2024-08-12 13:34:50 +02:00
Ben Barham
467e528200 Merge remote-tracking branch 'origin/main' into manual-rebranch-merge
Conflicts:
  - `lib/Serialization/ModuleFormat.h` bumped version to account for
    differences between main and rebranch.
2024-08-09 15:22:39 -07:00
Michael Gottesman
f275c27413 Merge pull request #75810 from gottesmm/pr-48fc81afd13a4e0fdcaaa5badf561845da837f6f
Clean up some NDEBUG code errors
2024-08-09 14:20:45 -07:00
Kavon Farvardin
9d69f2bceb Merge pull request #75382 from kavon/static-branch-prediction
Throws Prediction + HotColdSplitting
2024-08-09 15:24:22 -04:00
Michael Gottesman
2e08d6110d Fix SILBasicBlock::{dump,print}ID so that they are available in no-asserts but just print out NOASSERTS instead of a debug id. 2024-08-09 11:10:37 -07:00
Slava Pestov
375363a473 AST: Move global conformance lookup entry points to ConformanceLookup.h 2024-08-08 23:35:58 -04:00
Kavon Farvardin
0cce602bce SIL: branch weights for try_apply's 2024-08-08 21:21:52 -04:00
swift-ci
0a7bfc9b5c Merge remote-tracking branch 'origin/main' into rebranch 2024-08-08 17:15:49 -07:00