Commit Graph

11193 Commits

Author SHA1 Message Date
Nate Chandler
74c4bc9c55 [DAH] Bail on pointer use if ignoring barriers.
Unknown uses of raw pointers should not result in bailing out when an
address is lexical--the destroy of the address will already not be
hoisted over any instructions which may access pointers.  If the address
is not lexical however (such as any address when lexical lifetimes are
disabled), that rationale does not apply, so unknown uses of raw
pointers must cause hoisting to bail.

rdar://133969821
2024-08-27 16:18:39 -07:00
swift-ci
fa263c94dd Merge remote-tracking branch 'origin/main' into rebranch 2024-08-27 11:14:25 -07:00
Erik Eckstein
656e6cd4bb SemanticARCOpts: update borrowed-from instructions when changes are made
Fixes a SIL verifier error

rdar://134728428
2024-08-27 13:28:40 +02:00
swift-ci
cb27c2a61c Merge remote-tracking branch 'origin/main' into rebranch 2024-08-26 21:35:11 -07:00
Erik Eckstein
b54117c22d GenericSpecializer: drop unused indirect arguments.
If there is no read from an indirect argument, this argument has to be dropped.
At the call site the store to the argument's memory location could have been removed (based on the callee's memory effects).
Therefore, converting such an unused indirect argument to a direct argument, would load an uninitialized value at the call site.
This would lead to verifier errors and in worst case to a miscompile because IRGen can implicitly use dead arguments, e.g. for getting the type of a class reference.
2024-08-26 11:19:12 +02: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
b993d7d094 [region-isolation] Improve the logging so that we also dump a function's demangled name when processing it in RegionAnalysis.
Just trying to improve logging to speed up triaging further. This is useful so
that I can quickly find specific closures we process by using the closure
numbering (e.x.: closure #1 in XXXX).
2024-08-24 13:46:22 -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
Michael Gottesman
bbc4816861 [sema] Move getConcurrencyDiagnosticBehaviorLimit and hasExplicitSendableConformance out of Sema and into libAST.
I am going to expose this on TypeBase, so I am attempting to prevent a layering
violation in between AST and Sema.
2024-08-23 20:42:51 -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
Michael Gottesman
f075e4eb28 Change DiagnosticBehavior into a struct enum so we can put methods on it.
The reason why I am making this change is because I want to put a merge
operation on DiagnosticBehavior. This merge operation allows for
DiagnosticBehavior to work like a lattice. When one merges, one moves
potentially from fatal, error to things like note, ignore.
2024-08-22 15:59:04 -04:00
swift-ci
1b56b27c3b Merge remote-tracking branch 'origin/main' into rebranch 2024-08-22 12:34:33 -07:00
Erik Eckstein
b7e5ec825a MandatoryPerformanceOptimizations: force inlining of transparent functions and de-virtualization
Do this even if the function then contains references to other functions with wrong linkage. Instead fix the linkage later.
Fixes a false error in embedded swift.

rdar://134352676
2024-08-22 09:15:14 +02:00
swift-ci
0712db4d30 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-21 23:34:28 -07:00
eeckstein
b1a88beab5 Merge pull request #75836 from eeckstein/fix-vtable-specializer
VTableSpecializer: fix a crash for methods which have their own generic parameters
2024-08-22 08:20:19 +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
Erik Eckstein
ba9bfaf5d5 VTableSpecializer: fix a crash for methods which have their own generic parameters
rdar://133334324
2024-08-21 17:01:35 +02:00
Mykola Pokhylets
9a0df5bcbf Don't add swift_retainCount() to RuntimeFunctions.def, but explicitly link it in linkEmbeddedRuntimeFromStdlib() 2024-08-21 14:53:09 +02:00
swift-ci
e4951fa963 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 22:34:45 -07:00
eeckstein
011c127c16 Merge pull request #75987 from eeckstein/fix-embedded-errors
CrossModuleOptimization: serialized witness tables in embedded mode
2024-08-21 07:29:27 +02:00
swift-ci
b08f7a1307 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 13:58:19 -07:00
Slava Pestov
b434c9fb56 Merge pull request #75984 from slavapestov/clean-up-opened-archetype
Clean up OpenedArchetypeType construction and more
2024-08-20 16:52:55 -04:00
swift-ci
66cb8804c0 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-20 12:36:22 -07:00
Erik Eckstein
44d85c1f72 CrossModuleOptimization: serialized witness tables in embedded mode
This is needed so that client modules can de-virtualize witness method calls.

Fixes a false "cannot use a value of protocol type in embedded Swift" error.
rdar://133993657
2024-08-20 20:32:32 +02:00
Slava Pestov
ff308e9510 AST: Remove TypeBase::openAnyExistentialType() 2024-08-20 12:15:27 -04:00
Slava Pestov
0c2f28fd3d AST: Remove GenericSignature parameter from OpenedArchetypeType::get() 2024-08-20 12:15:27 -04:00
Erik Eckstein
9053cce8a4 SimplifyCFG: fix an ownership verifier error caused by switch_enum simplification
If constant folding a switch_enum ends up in branching to a no-payload case, the enum value still needs to be destroyed to satisfy the ownership verifier.

https://github.com/swiftlang/swift/issues/74903
rdar://131726690
2024-08-20 10:13:52 +02:00
swift-ci
97eaf355ae Merge remote-tracking branch 'origin/main' into rebranch 2024-08-19 18:34:33 -07:00
Slava Pestov
f4c3d8f7d6 Merge pull request #75966 from slavapestov/more-removal-of-root
Remove some usages of ArchetypeType::getRoot()
2024-08-19 21:18:05 -04:00
swift-ci
2c388b055e Merge remote-tracking branch 'origin/main' into rebranch 2024-08-19 16:34:37 -07:00
Michael Gottesman
083b10a879 Merge pull request #75963 from gottesmm/pr-fb279661a394bc36c6aea28f928d0c7e3adfdea4
[region-isolation] Tweak the logging to make it easier to quickly find the emitted error when triaging code.
2024-08-19 16:17:51 -07:00
swift-ci
97f3a1b5e1 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-19 15:15:58 -07:00
Michael Gottesman
582144a017 Merge pull request #75960 from gottesmm/pr-d0a4bbf70b470c53c7f2435ee53051da8fd643d3
[region-isolation] Move the region isolation logging decls out of PartitionUtils.h -> RegionIsolation.h
2024-08-19 15:06:51 -07:00
Slava Pestov
76ec591fde AST: hasOpenedExistentialWithRoot() => hasLocalArchetypeFromEnvironment() 2024-08-19 16:55:10 -04:00
Michael Gottesman
a36b3749dc [region-isolation] Tweak the logging to make it easier to quickly find the emitted error when triaging code.
Just trying to improve my triaging speed by making it easier to triage.
2024-08-19 12:25:54 -07:00
Michael Gottesman
b477433a20 [region-isolation] Move the region isolation logging decls out of PartitionUtils.h -> RegionIsolation.h
These do not specifically have to do with PartitionUtils... they are really
logging options for the whole infrastructure, so it makes sense to have them in
the a different file.
2024-08-19 11:28:55 -07:00
swift-ci
a5ec343a08 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-17 06:14:34 -07:00
Slava Pestov
0e853a358e Merge pull request #75935 from slavapestov/remove-transform
AST: Replace remaining uses of Type::transform() with transformRec()
2024-08-17 09:11:52 -04:00
swift-ci
bb96b71481 Merge remote-tracking branch 'origin/main' into rebranch 2024-08-15 17:26:32 -07:00
Michael Gottesman
03713498f7 Merge pull request #75873 from gottesmm/pr-6c64f2f0a43f93b59babd44b8bac2c396a039e2f
[region-isolation] Improve the error we emit for closure literals captured as a sending parameter.
2024-08-15 17:03:52 -07:00