Commit Graph

6583 Commits

Author SHA1 Message Date
Slava Pestov
9cf4d61ece Merge pull request #73685 from slavapestov/pack-expansion-closures-part-5
Pack expansion closures, part 5
2024-05-17 07:42:06 -04:00
swift-ci
5c0fe0fd6c Merge remote-tracking branch 'origin/main' into rebranch 2024-05-17 00:35:54 -07:00
Slava Pestov
c1ce0d72c2 SIL: Store captured environments in SILFunction 2024-05-16 23:00:44 -04:00
Tim Kientzle
f09fb7dfa4 Update a couple of files to pull assertion helpers from the new header 2024-05-16 12:50:23 -07:00
Erik Eckstein
f3dafbff2f SIL: make unchecked_ref_cast buildable in a global variable initializer 2024-05-16 21:34:35 +02:00
Michael Gottesman
e3e78ad6bb [sending] Change the internals of sending to be based around 'sending' instead of 'transferring'.
We still only parse transferring... but this sets us up for adding the new
'sending' syntax by first validating that this internal change does not mess up
the current transferring impl since we want both to keep working for now.

rdar://128216574
2024-05-16 12:20:45 -07:00
swift-ci
abf98a0f6c Merge remote-tracking branch 'origin/main' into rebranch 2024-05-16 11:34:58 -07:00
Augusto Noronha
e5a1d61ed8 Merge pull request #73145 from augusto2112/keep-for-deb-def
Fix functions not being kept for debugger
2024-05-16 11:32:43 -07:00
swift-ci
54bb79b61f Merge remote-tracking branch 'origin/main' into rebranch 2024-05-16 10:34:40 -07:00
Ellie Shin
1257db7342 Merge pull request #73566 from apple/elsh/sil-new-attr
[SIL] Add [serialized_for_package] to control package-wide resilience domain in Package-CMO.
2024-05-16 10:17:35 -07:00
swift-ci
35e784e3c2 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-15 19:14:47 -07:00
Slava Pestov
ff6cdeb881 Merge pull request #73625 from slavapestov/sil-cloner-local-archetypes-fix
Redo handling of local archetypes in SILCloner
2024-05-15 22:04:19 -04:00
Slava Pestov
388a2d7d35 SIL: Add some debugging code 2024-05-15 17:39:00 -04:00
Slava Pestov
62630365c2 SIL: Sink local archetype substitution into remapConformance() 2024-05-15 17:39:00 -04:00
Slava Pestov
a356b10929 SIL: Sink local archetype substitution into remapType() 2024-05-15 17:39:00 -04:00
Slava Pestov
0a0b17a660 SIL: Sink local archetype substitution into remapASTType() 2024-05-15 17:39:00 -04:00
Slava Pestov
3b5846d458 SIL: Sink local archetype substitution into remapSubstitutionMap() 2024-05-15 17:39:00 -04:00
Ellie Shin
2d81d0f2c7 [SIL] Add a new attribute [serialized_for_package] to support
package-wide resilience domain if Package CMO is enabled.

The purpose of the attribute includes:
- Indicates that certain types such as loadable types are
allowed in serialized functions in resiliently built module
if the optimization is enabled, which are otherwise disallowed.
- Used during SIL deserialization to determine whether such
functions are allowed.
- Used to determine if a callee can be inlined into a caller
that's serialized without package-cmo, e.g. with an explicit
annotation like @inlinable, where the callee was serialized
due to package-cmo.

Resolves rdar://127870822
2024-05-15 12:43:15 -07:00
Slava Pestov
4de6dca5d8 SIL: Fix latent bug in TypeSubstCloner::remapSubstitutionMap()
We didn't erase opaque archetypes like we did when remapping types
and conformances.
2024-05-15 11:51:31 -04:00
swift-ci
05d35ef466 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-14 19:13:42 -07:00
Kshitij Jain
c37d31cc64 Merge pull request #73596 from jkshtj/specialize
[Autodiff] Adds logic to generate specialized functions in the closure-spec pass
2024-05-14 18:55:23 -07:00
Slava Pestov
1cdb654ba2 SIL: Tidy up SILCloner 2024-05-14 13:48:08 -04:00
Augusto Noronha
529845056b Fix functions not being kept for debugger
At Onone, many types of functions (anything user written, compiler
generated setters and getters, etc), should be kept in the final
binary so they're accessible by the debugger.

rdar://126763340
2024-05-14 10:31:44 -07:00
swift-ci
d60bd76bc1 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-14 06:14:47 -07:00
Slava Pestov
a3590a228a SIL: Replace substitutionsChangeGenericTypeParameters() with isIdentity() check 2024-05-13 21:59:25 -04:00
Kshitij
74166a4ab6 [Autodiff] Moves bridging code accesses in closure-spec opt behind APIs
Addresses some other surfacial feedback as well.
2024-05-13 15:37:30 -07:00
swift-ci
333482e90b Merge remote-tracking branch 'origin/main' into rebranch 2024-05-13 11:36:59 -07:00
Michael Gottesman
4789cc7e55 Merge pull request #73556 from gottesmm/rdar127295657_127844737
[region-isolation] When inferring isolation for an argument, handle non-self isolated parameters as well as self parameters that are actor isolated.
2024-05-13 11:18:51 -07:00
Kshitij
ab751d57ab [Autodiff] Adds logic to generate specialized functions in the closure-spec pass 2024-05-13 11:16:42 -07:00
swift-ci
27875fab06 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-13 10:35:09 -07:00
Emil Pedersen
15cab3a19f Merge pull request #73555 from Snowy1803/complete-getvarinfo
[DebugInfo] Return complete variable info from getVarInfo by default
2024-05-13 10:32:43 -07:00
swift-ci
17fdfecc10 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-10 19:14:53 -07:00
Slava Pestov
6df0de5ba9 Merge pull request #73570 from slavapestov/pack-expansion-closures-part-4
Allow local archetypes in interface types of local declarations
2024-05-10 22:00:43 -04:00
Emil Pedersen
0be63d0422 [DebugInfo] Return complete variable info from getVarInfo by default
getVarInfo() now always returns a variable with a location and scope.
To opt out of this change, getVarInfo(false) returns an incomplete variable.
This can be used to work around bugs, but should only really be used for
printing.

The complete var info will also contain the type, except for debug_values,
as its type depends on another instruction, which may be inconsistent if
called mid-pass.

All locations in debug variables are now also stripped of flags, to avoid
issues when comparing or hashing debug variables.
2024-05-10 16:12:56 -07:00
Emil Pedersen
b2930992a8 [DebugInfo] Remove Expr from debug variables used as DenseMap keys
We do keep the fragment part of the expression as it is important
to identify fragments separately.

A variable with less fragments should be considered a superset of
variables with more fragments, but that would require to change a
lot of code.
2024-05-10 16:09:26 -07:00
Michael Gottesman
9bfb3b7ee7 [region-isolation] Some small gardening updates in preparation for the next commit.
Specifically, I added a few helper methods and improved the logging printing.
This all makes the next commit a more focused commit.
2024-05-10 15:33:44 -07:00
Slava Pestov
839e8ecb24 SIL: Add missing SILType::has*Archetype() predicates 2024-05-10 17:21:17 -04:00
swift-ci
8547389f7d Merge remote-tracking branch 'origin/main' into rebranch 2024-05-10 08:53:59 -07:00
Kshitij Jain
01654fd323 Merge pull request #71775 from jkshtj/main
[Autodiff] Adds part of the Autodiff specific closure-specialization optimization pass
2024-05-10 08:51:01 -07:00
swift-ci
38c797ea53 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-10 07:35:47 -07:00
Emil Pedersen
bc3bf84872 Fix crash in hash_value for SILLocation
We should not dereference the file position if this SILLocation is not a position.
If it's a pointer, we compare the pointers.
2024-05-09 14:57:00 -07:00
Nate Chandler
632406762c [LifetimeCompletion] Add availability_with_leaks.
The new boundary allows for invalid OSSA where values are not consumed
on paths leading to blocks that exit the function normally.  In such
cases, the value is allowed to continue leaking as before.
2024-05-08 17:15:15 -07:00
Nate Chandler
518de7c6b1 [LifetimeCompletion] Require boundary spec.
Don't default to one boundary or another based on whether the value
being completed is lexical.
2024-05-08 17:15:15 -07:00
Nate Chandler
2ee40246b8 [NFC] LifetimeCompletion: operator<<(boundary). 2024-05-08 17:15:14 -07:00
swift-ci
879b67d795 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-08 16:15:09 -07:00
Ellie Shin
0f606e76cb Merge pull request #73478 from apple/elsh/pcmo-res
Support generating loadable types in serialized function when package-cmo is enabled.
2024-05-08 16:08:13 -07:00
Adrian Prantl
9a2e245678 Merge pull request #73504 from Snowy1803/rdar127348128
[DebugInfo] Fix verifier crash for complex switch
2024-05-08 16:06:00 -07:00
Ellie Shin
9b28969e2d To support serializing functions containing loadable types in a resiliently built
module when package serialization is enabled, return maximal resilience expansion
in SILFunction::getResilienceExpansion(). This allows aggregate types to be generated
as loadable SIL types which otherwise are address-only in a serialized function.
During type lowering, opaque flag setting is also skipped if package serialization
is enabled.

Resolves rdar://127400743
2024-05-08 05:01:25 -07:00
Emil Pedersen
95d2479889 [DebugInfo] Fix verifier crash for complex switch
An alloc_stack, just like a debug_value, should ignore location
overrides for their variable.

Fixes #73338
rdar://127348128
2024-05-07 18:51:13 -07:00
Emil Pedersen
6136183c33 [DebugInfo] Fix loss of VarDecl in debug values for salvaged stores
When a store is salvaged, its debug_value will have two locations:
the location of the store, attached to the debug_value instruction,
and the location of the variable, attached to the SILDebugVariable.

The getDecl function was using the location of the store, instead
of the location of the variable, and so was returning nullptr.
2024-05-07 14:34:18 -07:00