Commit Graph

6648 Commits

Author SHA1 Message Date
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
swift-ci
e1bf084cc6 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-03 22:34:10 -07:00
nate-chandler
768b3a4944 Merge pull request #73422 from nate-chandler/rdar127502242
[SIL] Hollow out Builtin.copy and deprecate _copy.
2024-05-03 22:19:47 -07:00
Nate Chandler
06921cfe84 [SIL] Hollow out Builtin.copy, deprecate _copy.
The copy operator has been implemented and doesn't use it.  Remove
`Builtin.copy` and `_copy` as much as currently possible.

Source compatibility requires that `_copy` remain in the stdlib.  It is
deprecated here and just uses the copy operator.

Handling old swiftinterfaces requires that `Builtin.copy` be defined.
Redefine it here as a passthrough--SILGen machinery will produce the
necessary copy_addr.

rdar://127502242
2024-05-03 15:56:25 -07:00
swift-ci
0f21099e90 Merge remote-tracking branch 'origin/main' into rebranch 2024-05-03 15:14:09 -07:00
nate-chandler
b7a84da318 Merge pull request #73408 from nate-chandler/rdar127452206
[SILCombine] Handle indirect error in apply(convert_function).
2024-05-03 15:03:29 -07:00
Nate Chandler
d2a8128ca3 [SIL] Expose indirect error type on convention. 2024-05-03 08:06:21 -07:00
Nate Chandler
cad0761acb [Test] Expose current pass.
Some clients need to access their parent transformation.
2024-05-03 08:06:21 -07:00
swift-ci
118192a63b Merge remote-tracking branch 'origin/main' into rebranch 2024-05-02 16:55:08 -07:00
Slava Pestov
625436af05 Merge pull request #73393 from slavapestov/pack-expansion-closures-part-3
SIL type lowering support for closures that capture pack element archetypes
2024-05-02 19:43:24 -04:00
Slava Pestov
34fc06919b SIL: Allow setting SILFunction's forwarding substitution map 2024-05-02 14:28:30 -04:00
Slava Pestov
fa89c52556 SIL: Introduce TypeConverter::getForwardingSubstitutionsForLowering() 2024-05-02 14:28:30 -04:00
Slava Pestov
1cad5f9350 SIL: Plumb pack element captures through type lowering 2024-05-02 13:40:54 -04:00
Kshitij
a7f8d6c647 [Autodiff] Adds bridging code in preparation for the Swift based Autodiff closure-spec pass 2024-05-02 09:14:05 -07:00
swift-ci
1daa6b2fdc Merge remote-tracking branch 'origin/main' into rebranch 2024-05-01 18:15:54 -07:00
Nate Chandler
2ca995177c [NFC] LifetimeCompletion: Lift default a level. 2024-05-01 08:57:01 -07:00
Nate Chandler
5383df755a [NFC] LifetimeCompletion: Clarify modes.
Completion is done along a boundary, either the availability or the
liveness boundary.  Represent which with a type.  Update docs and names.
2024-05-01 08:57:01 -07:00
Ben Barham
bc78809a2e Revert "[SIL] Require TransformIterator support random access"
This reverts commit 095028562e.
2024-04-28 18:17:54 -07:00
swift-ci
e472f47611 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-26 07:14:44 -07:00
Nate Chandler
29d046fa42 [SIL] Add BorrowedValueKind::BeginApplyToken.
The token is a guaranteed value introduced by the begin_apply and
consumed by its end_apply, abort_apply, and end_borrow users.
2024-04-25 17:03:43 -07:00
Nate Chandler
5307ac666e [SIL] Permit end_borrow(begin_apply). 2024-04-25 17:03:41 -07:00
Nate Chandler
121b2faccc [NFC] SIL: Add ValueBase::isBeginApplyToken.
Forwards to the member function of the same name on
MultipleValueInstructionResult.
2024-04-25 17:03:11 -07:00
swift-ci
3ea8b187bb Merge remote-tracking branch 'origin/main' into rebranch 2024-04-25 16:54:34 -07:00
Emil Pedersen
a31d15c438 Merge pull request #72964 from Snowy1803/mem2reg-salvage-store
[DebugInfo] Salvage all stores
2024-04-25 16:52:37 -07:00
Emil Pedersen
584d1db307 [IRGen] [DebugInfo] Ignore autogenerated flag for variables 2024-04-24 18:25:43 -07:00
swift-ci
1cb60c0513 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-23 14:13:45 -07:00
Emil Pedersen
523a769e34 [DebugInfo] [Mem2Reg] Move debug info promotion to salvageDebugInfo 2024-04-23 13:12:21 -07:00
Michael Gottesman
025902fa99 [sil] Add a SILDeclRef field to SILFunction, have SILGen set it, and teach SILFunction how to use the field to get the SourceFile associated with the SILFunction. 2024-04-23 11:45:36 -05:00
swift-ci
45d8b8836d Merge remote-tracking branch 'origin/main' into rebranch 2024-04-22 07:14:47 -07:00
Nate Chandler
d28a12d356 [MoveOnlyAddressChecker] Handle enum deinits.
Previously, the enum representation was fixed to represent the different
cases payloads separately with the unchecked_take_enum_data_addr
instruction consuming all fields but that whose address is obtained.
In a few places, handling for enum deinits was left undone with an
assertion that the enum not have one.

Here, the deinit bit of the enum is shifted to the end.  And the
assertions are replaced with handling.  Finally, the logic for inserting
destroys after switch_enum_addr instructions is fixed.
2024-04-19 12:37:34 -07:00
swift-ci
83f346aafd Merge remote-tracking branch 'origin/main' into rebranch 2024-04-17 17:49:54 -07:00
Michael Gottesman
bfa910dcb1 Merge pull request #72959 from gottesmm/tns-upstream-2
[region-isolation] Do not look through begin_borrow or move_value if they are marked as a var_decl.
2024-04-17 17:42:19 -07:00
Nate Chandler
c43f87101f Merge branch 'main' into rebranch
Conflicts:
      lib/Basic/Platform.cpp

```
diff --git a/lib/Basic/Platform.cpp b/lib/Basic/Platform.cpp
index 240edfa144a..1797c87635f 100644
--- a/lib/Basic/Platform.cpp
+++ b/lib/Basic/Platform.cpp
@@ -200,10 +200,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
   case llvm::Triple::CUDA:
   case llvm::Triple::DragonFly:
   case llvm::Triple::DriverKit:
-<<<<<<< HEAD
   case llvm::Triple::ELFIAMCU:
-=======
->>>>>>> main
   case llvm::Triple::Emscripten:
   case llvm::Triple::Fuchsia:
   case llvm::Triple::HermitCore:
```
2024-04-17 13:32:48 -07:00
Michael Gottesman
3c29997cd1 [region-isolation] Out of an abundance of caution convert isActor -> isAnyActor(). 2024-04-17 13:07:56 -07:00
Adrian Prantl
6357d12cfc Merge pull request #73009 from Snowy1803/debuginfo-small-fixes
[Debuginfo] Small fixes
2024-04-17 00:03:53 +02:00
Emil Pedersen
5512df5837 [SILCloner] Remap debug variable type and scope at the same time (NFC) 2024-04-16 10:28:13 -07:00