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.
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.
commit bcc59744b7da00395708f41984ee2be70924cb6c
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date: Sat Jan 13 15:28:42 2024 +0400
applied suggested phrasing
commit b5b0f9622a5dca80cf79df41e4834959021329ca
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date: Fri Jan 12 23:48:12 2024 +0400
Added a note about hardware requirements for compiling on Linux
commit 863c1d98dd8c3c3e67610fe9ea9ac00e161d687a
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date: Fri Jan 12 23:47:19 2024 +0400
Moved note to Requirements section
commit 307d0027967945cdc5c0d28b9c4525fc27149f66
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date: Wed Jan 10 19:45:54 2024 +0400
Added a note about hardware requirements for compiling on Linux
commit 943ccc2726aa2f8850f38670b848304acb3359aa
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date: Wed Jan 10 19:45:13 2024 +0400
Replaced 'and' with 'plus' to ease comprehension
commit 3427ace37d63d398542aa80be6c30a27a940eef9
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date: Thu Jan 4 21:02:22 2024 +0400
Added a note about hardware requirements for compiling on Linux
commit 49bafe98a3c938e83af3de351094b47650836aee
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date: Thu Jan 4 20:49:35 2024 +0400
Added "of RAM" to each reference
commit 9dc879cb30e9c9507d78d5de3a1d0de2808979c6
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date: Thu Jan 4 14:13:20 2024 +0400
Updated text according to comment, removed mention of VM for Linux
commit b652195dcbedc7fa3a770075457880d544a78a60
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date: Wed Jan 3 00:06:18 2024 +0400
Added more information about different RAM requirements
commit 2aa1be00ce6ab66f50928484727e684a9eb5c243
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date: Mon Jan 1 03:19:22 2024 +0400
Added a note about Linux inside of a VM hardware requirements
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.
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.
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
* `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
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.
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.
This commit just introduces the instruction. In a subsequent commit, I am going
to add support to SILGen to emit this. This ensures that when we assign into a
tuple var we initialize it with one instruction instead of doing it in pieces.
The problem with doing it in pieces is that when one is emitting diagnostics it
looks semantically like SILGen actually is emitting code for initializing in
pieces which could be an error.