Commit Graph

166 Commits

Author SHA1 Message Date
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
Adrian Prantl
9cb0b8ef25 Zero-initialize -Onone debug shadow copies for exploded values
and simplify the initialization code by emitting a memset intrinsic.

rdar://problem/43566087
2018-09-14 17:20:11 -07:00
John McCall
c1f99b5fdb Cap type alignment in Swift at 16.
rdar://31411216
2018-08-28 16:13:50 -04:00
Johannes Weiss
bd2de10057 Builtin.isbitwisetakable 2018-08-24 16:03:38 +01:00
Erik Eckstein
7c06d4f8ab Remove the pinning built-ins.
They are not used anymore after removing the pinning adressors.
2018-08-23 12:47:56 -07:00
Michael Gottesman
a57ad403ec [silgen] Now that we have destructure, use it in RValue to reduce copies emitted by SILGen.
rdar://43493020
2018-08-20 08:52:51 -07:00
swift-ci
754277f34c Merge remote-tracking branch 'origin/master' into master-next 2018-06-24 23:49:42 -07:00
Slava Pestov
9aeb252e28 Migrate IRGen tests to Swift 4 2018-06-24 22:33:17 -07:00
swift-ci
19e6a7c9c0 Merge remote-tracking branch 'origin/master' into master-next 2018-06-20 07:50:00 -07:00
Slava Pestov
5d2752f7d2 Run tests with -swift-version 4 by default
Some test now fail, so add an explicit -swift-version 3.
2018-06-19 23:24:19 -07:00
swift-ci
358490b7dc Merge remote-tracking branch 'origin/master' into master-next 2018-06-01 13:49:45 -07:00
Adrian Prantl
a95791c1b8 Fix bugs that caused IRGen to behave differently when debug info was enabled.
It hass been a longstanding principle in LLVM that the presence of
debug info shall not affect code generation. This patch brings the
Swift frontend closer to this ideal:

- unconditionally emit shadow copies
- unconditionally bind type metadata

The extra allocas, bitcasts, geps, and stores being emitted get
optimized away when compiling at anything but -Onone. There are few
use-cases for compiling at -Onone without -g, so this shouldn't affect
performance for any real-world use-cases.
2018-06-01 11:17:39 -07:00
swift-ci
94f870732f Merge remote-tracking branch 'origin/master' into master-next 2018-05-23 08:49:20 -07:00
Arnold Schwaighofer
6267860a7e IRGen: Remove initializeBufferWithTakeOfBuffer in favor of memcpy
And update the existential container's initializeWithTake implementation
in the runtime. After only allowing bitwise takable values in the
inline buffer we can use memcpy to move existential container values.

rdar://31414907
SR-343
2018-05-22 13:05:00 -07:00
swift-ci
40a72602ba Merge remote-tracking branch 'origin/master' into master-next 2018-05-08 03:09:13 -07:00
David Zarzycki
995dec5d82 [Sema] Error if ObjC interop is needed when disabled 2018-05-07 14:43:04 -04:00
swift-ci
e9d2b9f2ed Merge remote-tracking branch 'origin/master' into master-next 2018-04-23 22:49:14 -07:00
Saleem Abdulrasool
d746a6d1db tests: annotate dllstorage on IRGen tests
This adds the dllstorage annotations on the tests.  This first pass gets
most of the IRGen tests passing on Windows (though has dependencies on
other changes).  However, this allows for the changes to be merged more
easily as we cannot regress other platforms here.
2018-04-23 20:21:10 -07:00
swift-ci
5a6207b3dc Merge remote-tracking branch 'origin/master' into master-next 2018-03-21 23:29:17 -07:00
Michael Gottesman
cb80f65f1e Remove plus_zero_test,plus_one_test from lit tests since they are no longer needed.
I am going to leave in the infrastructure around this just in case. But there is
no reason to keep this in the tests themselves. I can always just revert this
and I don't think merge conflicts are likely due to previous work I did around
the tooling for this.
2018-03-21 20:49:52 -07:00
swift-ci
d9d63fd702 Merge remote-tracking branch 'origin/master' into master-next 2018-03-19 23:07:30 -07:00
Michael Gottesman
e567bc9028 [+0-all-args] Enable +0 normal arguments.
rdar://34222540
2018-03-19 20:25:31 -07:00
swift-ci
7aea4d125c Merge remote-tracking branch 'origin/master' into master-next 2018-03-13 20:29:06 -07:00
Michael Gottesman
b00966e247 [+0-all-args] Add more module_names to tests to enable running their plus_zero variants.
rdar://34222540
2018-03-13 19:47:50 -07:00
swift-ci
c91d67599a Merge remote-tracking branch 'origin/master' into master-next 2018-03-11 17:48:59 -07:00
Michael Gottesman
8dd5ea9b60 [+0-all-args] Add a space after REQUIRES: plus_one_runtime to eliminate avoidable merge conflicts when editing other parts of the file.
This helps my tooling for enabling +0.
2018-03-11 16:19:09 -07:00
swift-ci
9fc03c25c4 Merge remote-tracking branch 'origin/master' into master-next 2018-03-10 10:28:59 -08:00
Michael Gottesman
e6e55df5ea [+0-all-args] Mark all tests that will need updates for +0 as requiring a plus_one_runtime. 2018-03-10 02:37:51 -08:00
swift-ci
130d44650b Merge remote-tracking branch 'origin/master' into master-next 2018-02-13 07:49:32 -08:00
Joe Shajrawi
6538d543f7 Builtins: add StringObjectOr and use it in the standard library 2018-02-13 11:12:55 +02:00
swift-ci
328391d927 Merge remote-tracking branch 'origin/master' into master-next 2018-01-29 13:42:47 -08:00
Greg Parker
e223f1fc9b [IRGen][runtime] Simplify runtime CCs and entry point ABIs (#14175)
* Remove RegisterPreservingCC. It was unused.
* Remove DefaultCC from the runtime. The distinction between C_CC and DefaultCC
  was unused and inconsistently applied. Separate C_CC and DefaultCC are
  still present in the compiler.
* Remove function pointer indirection from runtime functions except those
  that are used by Instruments. The remaining Instruments interface is
  expected to change later due to function pointer liability.
* Remove swift_rt_ wrappers. Function pointers are an ABI liability that we
  don't want, and there are better ways to get nonlazy binding if we need it.
  The fully custom wrappers were only needed for RegisterPreservingCC and
  for optimizing the Instruments function pointers.
2018-01-29 13:22:30 -08:00
Davide Italiano
adbc4103d5 [IRGen] Catch up with llvm @memcpy intrinsic changes. 2018-01-24 15:13:29 -08:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Pavel Yaskevich
0133827e55 [Mangling/ABI] NFC: Fix IRGen tests to reflect label mangling changes 2017-12-18 15:45:50 -08:00
John McCall
59e2ab4277 The callback to Builtin.once is a C function, not a Swift one.
If we want it to be a Swift function, we'll have to thunk in the
runtime when using a system implementaton like dispatch_once_f,
since the function pointer ABIs could be different, depending on
the target.  Dealing with that, or avoiding it on a per-target basis,
is more complexiity than a micro-optimization of the slow path of
this builtin could possibly be worth.
2017-12-16 02:22:13 -05:00
Arnold Schwaighofer
865d85bd1c Reapply the enum value witness patch
Revert "Revert "Merge pull request #12606 from aschwaighofer/single_payload_enum_witness""

This reverts commit c422f80307.
2017-10-31 17:28:15 -07:00
Arnold Schwaighofer
c422f80307 Revert "Merge pull request #12606 from aschwaighofer/single_payload_enum_witness"
This reverts commit 0b414e45c5, reversing
changes made to fb27e7d32a.

There are failures on the resilient bot and lldb test case fails.
2017-10-31 08:24:26 -07:00
Arnold Schwaighofer
0b414e45c5 Merge pull request #12606 from aschwaighofer/single_payload_enum_witness
Add value witnesses for single payload enums
2017-10-30 13:31:49 -07:00
Arnold Schwaighofer
e0646d4321 IRGen: Use swiftcc for swift_unexpectedError and swift_errorInMain
It is a runtime function defined in swift. This currently did not have
ABI implications because the ABI happened to be compatible but ...

SR-6235
rdar://problem/35222489
2017-10-27 10:56:44 -07:00
Arnold Schwaighofer
79d9a33f10 Fix one more test case 2017-10-24 13:51:28 -07:00
Arnold Schwaighofer
270160441d test/IRGen/builtins.swift is not an executable_test 2017-10-17 13:37:36 -07:00
Arnold Schwaighofer
3ae6d7cb4d runtime/IRGen: return the argument from swift_retain family of functions
On architectures where the calling convention uses the same argument register as
return register this allows the argument register to be live through the calls.

We use LLVM's 'returned' attribute on the parameter to facilitate this.

We used to perform this optimization via an optimization pass. This was ripped
out some time ago around commit 955e4ed652.
By using LLVM's 'returned' attribute on swift_*retain, we get the same
optimization from the LLVM backend.
2017-09-19 07:16:37 -07:00
Arnold Schwaighofer
074c822b79 Fix TypeInfo.assignArrayWithTake
Assignment needs to destroy the destination!

rdar://34435565
2017-09-14 13:51:08 -07:00
Arnold Schwaighofer
8a85a9efd5 Use array copy runtime implementation instead of the array value witnesses
And add builtins for the added runtime functions (assign-take, assign-copy).

rdar://27412867
SR-3376
2017-09-12 12:43:26 -07:00
Jordan Rose
6e0515f644 [test] Update tests for upstream changes in LLVM/Clang. 2017-07-25 14:46:17 -07:00
Joe Groff
81ea860d89 IRGen: Builtin.UnknownObject should not be hardcoded to use ObjC refcounting.
It's more appropriate to use `Unknown` refcounting, which we correctly handle in the face of non-ObjC-interop elsewhere. Fixes a problem where the Linux standard library would contain an unresolvable reference to `objc_release`.
2017-07-07 09:52:09 -07:00
Rintaro Ishizaki
3337d0330f [test] Add missing ':' for FileCheck directives (#10572)
In FileCheck tests, check prefixes must be immediately followed by ':'.
2017-06-27 07:25:07 +09:00
Arnold Schwaighofer
ca63326e1b Delete unused existential value witnesses from the old existential
implementation

And remove the SWIFT_RUNTIME_ENABLE_COW_EXISTENTIALS flag.
2017-06-02 14:34:41 -07:00
Roman Levenstein
d522618bac Add a new builtin called is_same_metatype for checking the equality between metatypes
Having such a builtin makes it easier for the optimizer to reason about what is actually happening.
I plan to add later some optimizations which can optimize pieces of code dominated by such a check.
2017-05-15 16:21:09 -07:00