Commit Graph

4174 Commits

Author SHA1 Message Date
Alastair Houghton
9d2dcb5c4e Merge pull request #71386 from al45tair/eng/PR-122302117
[Runtime] Add an option to produce non-symbolicated backtraces.
2024-02-08 11:14:26 +00:00
Nate Cook
e317febc9d Revert "Allow normal function results of @yield_once coroutines (#69843)"
This reverts commit aa5b505014.
2024-02-07 14:57:31 -06:00
John McCall
60807a76a4 Merge pull request #71433 from rjmccall/isolated-any-typechecking
Experimental type-checking support for `@isolated(any)` function types.
2024-02-07 14:07:53 -05:00
Anton Korobeynikov
aa5b505014 Allow normal function results of @yield_once coroutines (#69843)
This adds SIL-level support and LLVM codegen for normal results of a coroutine.

The main user of this will be autodiff as VJP of a coroutine must be a coroutine itself (in order to produce the yielded result) and return a pullback closure as a normal result.

For now only direct results are supported, but this seems to be enough for autodiff purposes.
2024-02-06 22:13:15 -08:00
John McCall
2f8a33cf0a Experimental type-checking support for @isolated(any) function types. 2024-02-06 22:54:27 -05:00
Alastair Houghton
dd0b826235 [Runtime] Improved symbolication option for backtracing.
Rather than just on or off, I've changed it to allow "off", "fast",
or "full".  "fast" means that we'll do symbol lookup, but we won't
try to find inline frames and we won't run line number programs
(those are the things that are taking considerable time in some
cases).

rdar://122302117
2024-02-06 17:38:20 +00:00
Alastair Houghton
6c7aeeb5f2 [Docs] Updated Backtracing docs with new symbolicate setting.
Document the new `symbolicate` setting.

rdar://122302117
2024-02-05 13:05:11 +00:00
Erik Eckstein
fcd5225f39 Mangling: add mangling for outlined value operations which must not use value witness functions 2024-02-05 12:33:18 +01:00
Erik Eckstein
86f23b089f SIL: add the [perf_constraint] flag in SILFunction
Specifies that the optimizer and IRGen must not add runtime calls which are not in the function originally.
This attribute is set for functions with performance constraints or functions which are called from functions with performance.
2024-02-05 12:26:30 +01:00
Kuba (Brecka) Mracek
2fa1022a91 Merge pull request #70687 from kubamracek/embedded-docs1
[embedded] Add an initial docs/EmbeddedSwift/UserManual.md
2024-02-03 13:06:57 -08:00
Kuba Mracek
770496b1c0 [embedded] Add Pico integration tutorial 2024-02-02 22:37:45 -08:00
Kuba Mracek
0affaafac7 [embedded] Expand on the Embedded Swift documentation, fill in several TODOs 2024-02-02 21:50:09 -08:00
Michael Gottesman
369f441702 [SIL.rst] Update end_unpaired_access docs to make it clear it does not have a result. 2024-02-02 14:50:10 -08:00
Guillaume Lessard
114f235d17 Merge pull request #71167 from vanvoorden/vanvoorden/inclusive-language
[Inclusive Language][Comments][Documentation] migrate "sanity" checks to "soundness" checks
2024-02-02 10:27:34 -08:00
Michael Gottesman
6725caa06f Merge pull request #71221 from gottesmm/pr-2ebba2c62b8662dc2f5e21de219fc0f595ec97d9
[SIL.rst] Add textual examples for some of the pack instructions.
2024-01-29 17:19:29 -08:00
Michael Gottesman
904b1a91a6 [SIL.rst] Add textual examples for some of the pack instructions.
Just writing some tests for the pack instructions and I would have found having
a textual SIL example in SIL.rst of how to write them to be useful. Just paying
it forward.
2024-01-29 12:43:00 -08:00
Arnold Schwaighofer
01df0ca1ff Merge pull request #71092 from aschwaighofer/outline_enum_addr_insts
IRGen: Outline by-address SIL enum instructions
2024-01-29 07:10:25 -08:00
Rick van Voorden
f8ae46b3f3 [inclusive-language] changed sanity to soundness 2024-01-25 18:18:02 -08:00
Arnold Schwaighofer
49e8ffb735 IRGen: Outline by-address SIL enum instructions
Use a heuristic to decide when to outline indirect enum operations.
2024-01-23 15:01:24 -08:00
Slava Pestov
4c275df6e5 Merge pull request #71087 from eltociear/patch-49
generics.tex: fix typo in generic-environments.tex
2024-01-23 11:55:29 -05:00
Andrew Trick
2ef870a52b Add LifetimeDependence utilities 2024-01-22 23:57:03 -08:00
Andrew Trick
37171e698a Handle mark_dependence [nonescaping] like a borrowing instruction. 2024-01-22 23:57:03 -08:00
Andrew Trick
3bf7e715e7 Add AddressUtils.swift 2024-01-22 23:42:54 -08:00
Ikko Eltociear Ashimine
05d5833e38 generics.tex: fix typo in generic-environments.tex
accomodates -> accommodates
2024-01-23 16:36:30 +09:00
Andrew Trick
801000f85f Update SIL-Utilities.md for new ownership utils. 2024-01-17 09:07:02 -08:00
Erik Eckstein
04a6bbbb7a docs: add documentation for the -sil-pass-count-config-file option in DebuggingTheCompiler
Also, add this option in swift-autocomplete.bash.
Unrelated: support aliased commands in swift-autocomplete.bash
2024-01-11 11:10:05 +01:00
Erik Eckstein
bc99986cf9 SIL: add a dependency token operand to global_addr
Optionally, the dependency to the initialization of the global can be specified with a dependency token `depends_on <token>`.
This is usually a `builtin "once"` which calls the initializer for the global variable.
2024-01-10 09:33:58 +01:00
Andrew Trick
264cbaea42 Add mark_dependence [nonescaping] flag.
The dependent 'value' may be marked 'nonescaping', which guarantees that the
lifetime dependence is statically enforceable. In this case, the compiler
must be able to follow all values forwarded from the dependent 'value', and
recognize all final (non-forwarded, non-escaping) use points. This implies
that `findPointerEscape` is false. A diagnostic pass checks that the
incoming SIL to verify that these use points are all initially within the
'base' lifetime. Regular 'mark_dependence' semantics ensure that
optimizations cannot violate the lifetime dependence after diagnostics.
2024-01-04 14:47:35 -08:00
Kuba Mracek
31f821a455 [embedded] Add an initial docs/EmbeddedSwift/UserManual.md 2024-01-03 15:21:22 +01:00
SooHwanCho
6c6026ffb9 fix syntax error in generics.bib 2023-12-30 21:13:43 +09:00
Michael Gottesman
58a6e2aa4d [region-isolation] Add Asserting support for {alloc,dealloc}_pack_metadata since they only appear in Lowered SIL.
I also added a note to the SIL.rst and an assert into the SILVerifier to better
document this requirement.
2023-12-18 12:35:40 -08:00
Pavel Yaskevich
931342c76a Merge pull request #70374 from finagolfin/nux
[docs] GettingStarted: Update the linux instructions to use a prebuilt Swift compiler
2023-12-14 10:41:16 -08:00
Egor Zhdan
40ce4b0693 Merge pull request #70395 from ecbadeaux/Issue_69525
[Docs] Change (return this) to (return self)
2023-12-13 16:05:55 +01:00
Everett Badeaux
96fb3a0477 [Docs] Change return this to say return self
Signed-off-by: Everett Badeaux <everettc1810@gmail.com>
2023-12-12 17:33:56 -06:00
Finagolfin
22e1ed3acd [docs] GettingStarted: Update the linux instructions to use a prebuilt Swift compiler 2023-12-12 08:02:39 +05:30
Michael Gottesman
f328e7893b [region-isolation] Add support for representing ApplyIsolationCrossing at the SIL level on apply, begin_apply, try_apply.
Some notes:

This is not emitted by SILGen. This is just intended to be used so I can write
SIL test cases for transfer non sendable. I did this by adding an
ActorIsolationCrossing field to all FullApplySites rather than adding it into
the type system on a callee. The reason that this makes sense from a modeling
perspective is that an actor isolation crossing is a caller concept since it is
describing a difference in between the caller's and callee's isolation. As a
bonus it makes this a less viral change.

For simplicity, I made it so that the isolation is represented as an optional
modifier on the instructions:

  apply [callee_isolation=XXXX] [caller_isolation=XXXX]

where XXXX is a printed representation of the actor isolation.

When neither callee or caller isolation is specified then the
ApplyIsolationCrossing is std::nullopt. If only one is specified, we make the
other one ActorIsolation::Unspecified.

This required me to move ActorIsolationCrossing from AST/Expr.h ->
AST/ActorIsolation.h to work around compilation issues... Arguably that is where
it should exist anyways so it made sense.

rdar://118521597
2023-12-11 19:27:27 -06:00
Erik Eckstein
e652f2c92e SIL: add the alloc_vector and vector instructions
* `alloc_vector`: allocates an uninitialized vector of elements on the stack or in a statically initialized global
* `vector`: creates an initialized vector in a statically initialized global
2023-12-09 18:49:55 +01:00
Dario Rexin
36dd2c9450 [SilOpt] Add new layout type _TrivialStride and add pre-specialization suppport for it (#70308)
rdar://119329771

This layout allows adding pre-specializations for trivial types that have a different size, but the same stride. This is especially useful for collections, where the stride is the important factor.
2023-12-09 08:13:50 -08:00
Dario Rexin
df35f3327d [SilOpt] Add new layout _BridgeObject and add pre-specialization support for it (#70239)
rdar://119048001
2023-12-08 14:34:16 -08:00
Andrew Trick
ca16677608 Merge pull request #70052 from atrick/comment_drop_deinit
SIL: comment drop_deinit instruction.
2023-11-28 16:50:02 -08:00
Andrew Trick
8bec26bd33 SIL: comment drop_deinit instruction. 2023-11-28 12:35:01 -08:00
nate-chandler
126022f6e9 Merge pull request #70054 from nate-chandler/rdar118059326
[SIL] Key consume checking off var_decl attr.
2023-11-28 11:47:04 -08:00
Nate Chandler
b4f783e660 [SIL] Added var_decl flag to borrows/moves. 2023-11-28 07:26:08 -08:00
Nate Chandler
15182295c5 [SIL] Preserve pointer_escape flag during cloning. 2023-11-28 07:26:08 -08:00
Doug Gregor
36a2dcd927 Implement function body macros
Function body macros allow one to introduce a function body for a
particular function, either providing a body for a function that
doesn't have one, or wholesale replacing the body of a function that
was written with a new one.
2023-11-27 17:04:55 -08:00
Erik Eckstein
60070030f4 SIL.rst: make it clear that end_lifetime can also have an address operand. 2023-11-27 09:21:34 +01:00
Alex Hoppen
3bd764d70b Merge pull request #69897 from ahoppen/ahoppen/doc-lsan-ci-failures
[Docs] Add documentation how to diagnose LSAN CI failures
2023-11-16 11:45:40 -08:00
Alex Hoppen
bbb06a715f [Docs] Add documentation how to diagnose LSAN CI failures 2023-11-15 13:41:11 -08:00
Andrew Trick
cf2aeb8c17 Fix SIL.rst formatting in a few places.
This fixes errors in my local build.
2023-11-15 11:25:41 -08:00
Mishal Shah
786a0ba399 [Doc] Drop support for test and merge, and users should use auto-merge feature on GitHub 2023-11-08 13:17:35 -08:00