Commit Graph

11193 Commits

Author SHA1 Message Date
John McCall
db157c94ef Strengthen verification of the operand of hop_to_executor and extract_executor. 2024-10-30 14:41:50 -07:00
Meghana Gupta
58ddf0a884 Merge pull request #77279 from meg-gupta/ossasilcombine
Fix SILCombine of inject_enum_addr of ~Copyable values
2024-10-29 22:10:54 -07:00
Meghana Gupta
d58d97d97a Fix SILCombine of inject_enum_addr of ~Copyable values
Fixes rdar://138798467
2024-10-29 14:09:57 -07:00
elsh
60f0eac73a Fix canSerialize logic 2024-10-29 12:28:39 -07:00
elsh
6676288005 Revert "Revert "Merge pull request #76832 from swiftlang/elsh/pcmo-refactor""
This reverts commit 056d4474ad.
2024-10-28 17:24:24 -07:00
Ben Barham
f59b2f19e6 Merge branch 'main' into 2024-rebranch-to-main 2024-10-28 13:03:35 -07:00
Michael Gottesman
2b6b98d767 Merge pull request #77238 from gottesmm/region_isolation_refactoring
[region-isolation] Refactor code so that I can more easily add additional error kinds
2024-10-25 22:13:43 -07:00
Michael Gottesman
067dbadfef [region-isolation] Add a print command that emits errors of the form "*-isolated code" or "code in the current task"
This makes it so that one does not need to deal with the differences in text in
between the task isolated case and the actor isolated case. This is done by
swallowing the entire part of this message in one method rather than having the
caller do the work.
2024-10-25 16:57:55 -07:00
Michael Gottesman
e49ef778f1 [region-isolation] Rename RequireInOutSendingAtFunctionExit -> InOutSendingAtFunctionExit.
I am going to be doing more types of checks for such inout sending types, so it
makes sense to rename it to have a more general name.
2024-10-25 16:57:54 -07:00
Erik Eckstein
ed67e36ce5 bridging: reduce #ifdef USED_IN_CPP_SOURCE in bridging headers
Especially avoid any constructors in `#ifdef USED_IN_CPP_SOURCE` blocks, because this breaks Windows ARM64.
2024-10-25 09:47:56 +02:00
Michael Gottesman
df24fc41ce [region-isolation] Convert AssignIsolatedIntoSendingResult to be emitted as a verbatim error. 2024-10-24 16:27:21 -07:00
Michael Gottesman
4265aa1d71 [region-isolation] Refactor InOutSendingNotDisconnectedAtExit to use the error from PartitionUtils.h rather than have its own type. 2024-10-24 16:26:12 -07:00
Michael Gottesman
16bbd260ce [region-isolation] Refactor SentNeverSendable to use the new error type generated by PartitionUtils. 2024-10-24 16:02:57 -07:00
Michael Gottesman
2e403b9a7e [region-isolation] Remove dead code path.
This also has the nice effect of making the subsequent refactoring I am going to
do simpler.
2024-10-24 15:11:50 -07:00
Michael Gottesman
f23ad55acb [region-isolation] Eliminate CRTP for errors and just pass through an error struct instead.
This is going to let me just pass through the error struct to the diagnostic
rather than having the CRTP and then constructing an info object per CRTP.
Currently, to make it easier to refactor, I changed the code in
TransferNonSendable to just take in the new error and call the current CRTP
routines. In the next commit, I am going to refactor TransferNonSendable.cpp
itself. This just makes it easier to test that I did not break anything.
2024-10-24 15:00:43 -07:00
swift-ci
5bd2fd586a Merge remote-tracking branch 'origin/main' into rebranch 2024-10-22 23:14:53 -07:00
eeckstein
9a845a0f93 Merge pull request #77148 from eeckstein/reinstate-load-copy-to-borrow-opt
Reinstate the load-copy-to-borrow optimization
2024-10-23 08:03:14 +02:00
swift-ci
3d969906c5 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-22 13:14:35 -07:00
Andrew Trick
36e14c7c9b Merge pull request #77160 from atrick/moveonly_markdep
Add move-only checker support for dependencies
2024-10-22 13:04:55 -07:00
swift-ci
6bbdf7dac2 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-22 12:14:27 -07:00
Kuba (Brecka) Mracek
3ab2314e8c Merge pull request #77154 from kubamracek/embedded-onone
[GenericCloner] Propagate @_optimize(none) when cloning
2024-10-22 12:06:53 -07:00
Andrew Trick
fc9d0b3340 [MoveOnlyAddrChecker] fix VariableNameInferrer for mark_depends
Fix the use-def address walk to pass through mark_dependence to find a variable
introducer with a debug_value use.
2024-10-22 09:28:54 -07:00
Andrew Trick
17a3b8a8a3 [MoveAddrChecker] load from borrowed value looks through mark_depend
Required to add dependencies to unsafe addressors.
2024-10-22 09:27:02 -07:00
Andrew Trick
bdcc4099c7 [MoveObjectChecker] same-inst checking for mark_depends
Extends checkForSameInstMultipleUseErrors to ignore irrelevant unowned uses,
including the mark_dependence base operand, which is currently considered a
pointer escape.
2024-10-22 09:27:02 -07:00
Andrew Trick
508e6760ec [MoveObjectChecker] handle mark_depends
MoveOnlyBorrowsToDestructure: fix gatherBorrows to ignore mark_dependence base
operand uses.
2024-10-22 09:27:02 -07:00
Erik Eckstein
b8026d74e6 Revert "Revert "Optimizer: improve the load-copy-to-borrow optimization and implement it in swift""
This reverts commit 0666c446ec.
2024-10-22 08:40:18 +02:00
swift-ci
7a23cece8d Merge remote-tracking branch 'origin/main' into rebranch 2024-10-21 17:16:48 -07:00
Kuba Mracek
84b69f0c56 [GenericCloner] Propagate @_optimize(none) when cloning 2024-10-21 16:47:19 -07:00
Nate Chandler
9c887a1ab1 [MoveAddrChecker] Init'd looks thru mark_depend.
Extend the hack to determine whether an address begins initialized to
look through mark_dependence instructions.
2024-10-21 09:50:02 -07:00
Nate Chandler
0b47442068 [NFC] MoveAddrChecker: Extract reused expression.
To enable changing its definition.
2024-10-21 09:49:59 -07:00
Nate Chandler
062d063764 [NFC] MoveAddrChecker: Extracted function.
While the FIXME to derive whether an address begins initialized requires
auditing all sites where the instruction is emitted to begin with,
making this a predicate that depends only on the instruction can be done
now.
2024-10-21 09:49:38 -07:00
swift-ci
138625f758 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-18 10:41:34 -07:00
elsh
056d4474ad Revert "Merge pull request #76832 from swiftlang/elsh/pcmo-refactor"
This reverts commit 6b5df5225c, reversing
changes made to b5e3f42cad.
2024-10-18 09:57:43 -07:00
swift-ci
b13deba7f0 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-18 08:44:07 -07:00
Erik Eckstein
0666c446ec Revert "Optimizer: improve the load-copy-to-borrow optimization and implement it in swift"
This reverts commit eed8645610.
2024-10-18 10:36:06 +02:00
swift-ci
5bfc87531f Merge remote-tracking branch 'origin/main' into rebranch 2024-10-17 18:21:11 -07:00
Michael Gottesman
0e0665bfbd [concurrency] Add support for HopToMainActorIfNeededThunk.
It is behind the experimental flag GenerateForceToMainActorThunks.
2024-10-17 13:31:39 -07:00
Michael Gottesman
f0f5ad54fd [thunk-lowering] Add support for mangling identity thunks.
This is just again using identity thunks to show that the behavior works before
I add in hop to main actor.
2024-10-17 11:17:38 -07:00
swift-ci
594a7d7782 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-17 10:21:12 -07:00
Meghana Gupta
a49d8ff1a3 Merge pull request #77061 from meg-gupta/dcecast
DCE unconditional_checked_cast
2024-10-17 10:15:23 -07:00
swift-ci
70ece60b69 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-17 10:11:01 -07:00
Meghana Gupta
5d4e1d000b Merge pull request #77058 from meg-gupta/fixreleasehoisting
Update swift::canUseObject for unconditional_checked_cast
2024-10-17 09:55:33 -07:00
Meghana Gupta
359f6d14bf DCE unconditional_checked_cast 2024-10-16 16:55:22 -07:00
Meghana Gupta
4ab0a891b4 Update swift::canUseObject for unconditional_checked_cast
unconditional_checked_cast can read the pointer, update swift::canUseObject to return false for this.

Previously, if unconditional_checked_cast was dead, we could get a miscompile because of release hoisting.

Fixes rdar://137990246
2024-10-16 16:26:49 -07:00
swift-ci
b740acca62 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-16 16:09:51 -07:00
Ellie Shin
e362264b37 Merge pull request #77054 from swiftlang/elsh/pcmo-merge-funcs
[NFC] [Package CMO] Move shouldSerialize into canSerializeFunction
2024-10-16 15:41:07 -07:00
swift-ci
afd7266ff7 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-16 14:17:33 -07:00
Andrew Trick
24ed33bec0 Merge pull request #77040 from atrick/predmem_markdep
PredictableMemOpts: handle mark_dependence
2024-10-16 14:00:46 -07:00
swift-ci
c5a026a46b Merge remote-tracking branch 'origin/main' into rebranch 2024-10-16 12:14:51 -07:00
elsh
e0945e9d0d [Package CMO] Move shouldSerialize into canSerializeFunction
Remove redundant checks and consolidate serializability logic into one.
2024-10-16 12:05:04 -07:00