Commit Graph

9 Commits

Author SHA1 Message Date
Erik Eckstein
03d393ef5c Re-apply r27206: Convert all external function definitions to declarations when compiling with -Onone.
... with disabled test 1_stdlib/Bit.swift for ios.

Most likely the problem of 1_stdlib/Bit.swift (only on armv7) is just uncovered by this change.
Unfortunately I have no possibility to debug the problem on a device. Therefore I filed rdar://problem/20521110




Swift SVN r27274
2015-04-14 07:38:28 +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
Greg Parker
a42837bee2 Revert r27206.
This broke test 1_stdlib/Bit.swift on armv7.


Swift SVN r27236
2015-04-11 07:28:41 +00:00
Erik Eckstein
c3b253d305 Convert all external function definitions to declarations when compiling with -Onone.
This avoids that an unoptimized imported function is linked instead the optimized version from the stdlib.
rdar://problem/20485253

It gives considerable performance improvmenets for some benchmarks with -Onone. E.g.
PopFrontUnsafePointer: +281%
ArrayOfPOD: +92%
StrComplexWalk: +91%
ArrayOfGenericPOD: +61%
Several others are within the range of +10% to +30%.

For the implementation I added runSILPassesForOnone() in Passes.cpp.
Here we can add other optimizations for -Onone in the future.



Swift SVN r27206
2015-04-10 09:53:17 +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
Joe Groff
e3f9a2035c SIL: Move SILGen and passes over to use "builtin" instead of "apply (builtin_function_ref)".
Swift SVN r22785
2014-10-15 23:37:22 +00:00
Erik Eckstein
c16c510167 Set SILLinkage according to visibility.
Now the SILLinkage for functions and global variables is according to the swift visibility (private, internal or public).

In addition, the fact whether a function or global variable is considered as fragile, is kept in a separate flag at SIL level.
Previously the linkage was used for this (e.g. no inlining of less visible functions to more visible functions). But it had no effect,
because everything was public anyway.

For now this isFragile-flag is set for public transparent functions and for everything if a module is compiled with -sil-serialize-all,
i.e. for the stdlib.

For details see <rdar://problem/18201785> Set SILLinkage correctly and better handling of fragile functions.

The benefits of this change are:
*) Enable to eliminate unused private and internal functions
*) It should be possible now to use private in the stdlib
*) The symbol linkage is as one would expect (previously almost all symbols were public).

More details:

Specializations from fragile functions (e.g. from the stdlib) now get linkonce_odr,default
linkage instead of linkonce_odr,hidden, i.e. they have public visibility.
The reason is: if such a function is called from another fragile function (in the same module),
then it has to be visible from a third module, in case the fragile caller is inlined but not
the specialized function.

I had to update lots of test files, because many CHECK-LABEL lines include the linkage, which has changed.

The -sil-serialize-all option is now handled at SILGen and not at the Serializer.
This means that test files in sil format which are compiled with -sil-serialize-all
must have the [fragile] attribute set for all functions and globals.

The -disable-access-control option doesn't help anymore if the accessed module is not compiled
with -sil-serialize-all, because the linker will complain about unresolved symbols.

A final note: I tried to consider all the implications of this change, but it's not a low-risk change.
If you have any comments, please let me know.



Swift SVN r22215
2014-09-23 12:33:18 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Manman Ren
8cd676143a SIL Serialization: handle more SILInstructions
Add serialization/deserialization of the following SILInstructions:
BuiltinFunctionRefInst, IndexRawPointerInst, ModuleInst,
Conversion instructions:
  RefToObjectPointerInst, UpcastInst, CoerceInst, AddressToPointerInst,
  PointerToAddressInst, ObjectPointerToRefInst, RefToRawPointerInst,
  RawPointerToRefInst, RefToUnownedInst, UnownedToRefInst
DestroyAddrInst, LoadInst, StrongReleaseInst, StrongRetainInst,
TupleElementAddrInst, TupleExtractInst

Make getModule in ModuleFile public to be used by SILDeserializer, also
make addModuleRef in Serializer public to be used by SILSerializer.

Update testing case to cover the above SILInstructions.


Swift SVN r8372
2013-09-18 00:25:23 +00:00