Commit Graph

30 Commits

Author SHA1 Message Date
Erik Eckstein
c578c937c8 SILOptimizer: run the GlobalOpt pass in the mandatory pipeline.
Replace the dynamic initialization of trivial globals with statically initialized globals, even in -Onone.
This is required to be able to use global variables in performance-annotated functions.
Also, it's a small performance improvement for -Onone.
2021-10-29 22:35:57 +02:00
Hamish Knight
b3dcef9796 Avoid unnecessary linking in SIL tools
Previously we were linking in all SIL entities
if the input was a serialized non-SIB AST, and
`-disable-sil-linking` wasn't specified. However
none of the tests appear to want this behaviour.

Stop calling `SerializedSILLoader::getAll`, and
remove the `-disable-sil-linking` option, as this
is now the default behaviour.
2020-07-01 23:14:01 -07:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
Andrew Trick
3992a8c94f Print and parse the [canonical] function attribute. 2018-02-27 09:53:13 -08:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Roman Levenstein
35a624bb15 Update tests after removing -sil-serialize-witness-tables 2017-10-20 19:45:29 -07:00
Roman Levenstein
dd85e69e7f Update the tests after removing the -sil-serialize-all option 2017-10-04 14:20:53 -07:00
Alex Hoppen
1c7e289b96 [Mangling] Adjust subscript mangling to not include "subscript"
Change the mangling of accessors to have a variable or subscript node
as their only child node, while subscript nodes no longer contain a decl
name.
2017-09-10 19:44:07 +02:00
Dmitri Gribenko
984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Jordan Rose
47d8e74819 Add -disable-sil-linking to four simple SIL serialization tests. (#9723)
What these tests are testing has nothing to do with whether or not we
deserialize anything from the standard library, and not doing so saves
more than two minutes (single-threaded) on my machine from each test.
2017-05-17 19:29:37 -07:00
Slava Pestov
8fe8b89b0f SIL: Terminology change: [fragile] => [serialized]
Also, add a third [serializable] state for functions whose bodies we
*can* serialize, but only do so if they're referenced from another
serialized function.

This will be used for bodies synthesized for imported definitions,
such as init(rawValue:), etc, and various thunks, but for now this
change is NFC.
2017-03-29 16:47:28 -07:00
Erik Eckstein
c4a11f4c92 tests: remove the now unused option -new-mangling-for-tests 2017-03-22 11:28:43 -07:00
Erik Eckstein
720676f3ee tests: more tests converted to the new mangling under the -new-mangling-for-tests option 2017-01-26 08:54:31 -08:00
Dmitri Gribenko
55864d10cb Tests: use 'mkdir -p' 2016-09-02 21:36:45 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Slava Pestov
6b92d95683 Revert "SILGen: Explicitly make fragile entities public when -sil-serialize-all is on"
This reverts commit 9a7a517001.

See the discussion here for details:

<672356047d>
2016-06-06 17:28:55 -06:00
Slava Pestov
9a7a517001 SILGen: Explicitly make fragile entities public when -sil-serialize-all is on
Previously IRGen would force all fragile entities to have public linkage.
It makes more sense to do this in SILGen instead, and only when
-sil-serialize-all is on.

This patch was previously committed and reverted; the optimizer
issues exposed by the original version should now be fixed.
2016-04-08 02:46:44 -07:00
Ben Langmuir
54a411d4d9 Revert "SILGen: Explicitly make fragile entities public when -sil-serialize-all is on"
This commit caused link failures across several stdlib tests.

This reverts commit 672356047d.
2016-03-29 13:31:15 -07:00
Slava Pestov
672356047d SILGen: Explicitly make fragile entities public when -sil-serialize-all is on
Previously IRGen would force all fragile entities to have public linkage.
It makes more sense to do this in SILGen instead, and only when
-sil-serialize-all is on.
2016-03-28 14:59:05 -07:00
Mark Lacey
517723dbe9 Add -enable-sil-verify-all to sil-opt tests.
Also remove -verify from almost all of them, since only two actually
have expected diagnostic output that is tested.

Swift SVN r32198
2015-09-24 07:25:15 +00:00
Joe Groff
c0a2994564 AST: Start printing function types with @convention instead of old attributes.
And update tests to match.

Swift SVN r27262
2015-04-13 22:51:34 +00:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
John McCall
dc4431ebff Split addressors into unsafe, owning, and pinning variants.
Change all the existing addressors to the unsafe variant.

Update the addressor mangling to include the variant.

The addressor and mutable-addressor may be any of the
variants, independent of the choice for the other.

SILGen and code synthesis for the new variants is still
untested.

Swift SVN r24387
2015-01-13 03:09:16 +00:00
Dave Abrahams
90a34d86fa Mangle names of globalinit_{token,func} like other private entities.
This allows making global addressors fragile (They use globalinit_{token,func} for initialization of globals).

It has no noticable performance impact on our benchmarks, but it removes an ugly hack which explicitly
prevented addressors from being fragile.

Swift SVN r22812
2014-10-17 06:02:22 +00:00
Dave Abrahams
e4588e4896 Revert "Mangle names of globalinit_{token,func} like other private entities."
This reverts r22795, because it broke my RelWithDebInfo,
SWIFT_OPTIMIZED=NO build.

Swift SVN r22802
2014-10-16 21:12:11 +00:00
Erik Eckstein
b5cfd00f74 Mangle names of globalinit_{token,func} like other private entities.
This allows making global addressors fragile (They use globalinit_{token,func} for initialization of globals).

It has no noticable performance impact on our benchmarks, but it removes an ugly hack which explicitly
prevented addressors from being fragile.



Swift SVN r22795
2014-10-16 08:24:18 +00:00
Manman Ren
fdcb617d8e [Serializer] update SIL linkage of global addressors in getAllSILFunctions.
We currently do not serialize the body of global addressors. To make
"sil-opt swiftmodule" pass verification, we change the linkage for
the deserialized empty global addressors from public to public external.

rdar://18021024


Swift SVN r22370
2014-09-29 22:18:34 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Andrew Trick
f58ebbc251 Add a global_init attribute to SILFunction.
The implied semantics are:
- side-effects can occur any time before the first invocation.
- all calls to the same global_init function have the same side-effects.
- any operation that may observe the initializer's side-effects must be
  preceded by a call to the initializer.

This is currently true if the function is an addressor that was lazily
generated from a global variable access. Note that the initialization
function itself does not need this attribute. It is private and only
called within the addressor.

Swift SVN r16683
2014-04-23 01:09:47 +00:00